# Round (Real)

Grammar — Round(x)
FlagsNative | Function

Returns the value rounded to zero decimal places.

# Arguments

  • fixed — Value

Returns — fixed

native fixed Round(fixed x);

Category: Math / Arithmetic

# Examples

mods/heroesdata.stormmodbase.stormdata/TriggerLibs/SoundLib.galaxy:1378


    if ((lv_triggeringPlayer >= 1) && (lv_triggeringPlayer <= libCore_gv_bALMaxPlayers) && (UnitTestState(lv_triggeringUnit, c_unitStateHallucination) == false) && (lv_damagingPlayer != UnitGetOwner(lv_triggeringUnit)) && (UnitTestState(lv_triggeringUnit, c_unitStateInvulnerable) == false) && ((lv_triggeringUnit == libGame_gv_players[lv_triggeringPlayer].lv_heroUnit) || (lv_triggeringUnit == libGame_gv_players[lv_triggeringPlayer].lv_activeVehicle))) {
        lv_damageDone = Round((EventUnitDamageAttemptedVitals() + EventUnitDamageBehaviorShield()));
        libSond_gf_HeroVOHeroGetHitResponse(lv_damageDone, lv_triggeringUnit);
    }

mods/heroesdata.stormmodbase.stormdata/TriggerLibs/UILib.galaxy:11701

    lv_targetUnit = lv_impactUnit;
    lv_casterUnit = lv_casterUnit;
    if ((Round(CatalogFieldValueGetAsFixed(c_gameCatalogBehavior, lv_shieldBehavior, "DamageResponse.ModifyLimit", lv_launchPlayer)) <= 0.0)) {
        if ((Round(CatalogFieldValueGetAsFixed(c_gameCatalogBehavior, lv_shieldBehavior, "DamageResponse.ModifyLimitVitalMaxFractionArray[" + IntToString(2) + "]", lv_launchPlayer)) <= 0.0)) {
            lv_amount = CatalogFieldValueGetAsFixed(c_gameCatalogBehavior, lv_shieldBehavior, "DamageResponse.ModifyLimitVitalMaxFractionArray[" + IntToString(0) + "]", lv_launchPlayer);

mods/heroesdata.stormmodbase.stormdata/TriggerLibs/UILib.galaxy:11702

    lv_casterUnit = lv_casterUnit;
    if ((Round(CatalogFieldValueGetAsFixed(c_gameCatalogBehavior, lv_shieldBehavior, "DamageResponse.ModifyLimit", lv_launchPlayer)) <= 0.0)) {
        if ((Round(CatalogFieldValueGetAsFixed(c_gameCatalogBehavior, lv_shieldBehavior, "DamageResponse.ModifyLimitVitalMaxFractionArray[" + IntToString(2) + "]", lv_launchPlayer)) <= 0.0)) {
            lv_amount = CatalogFieldValueGetAsFixed(c_gameCatalogBehavior, lv_shieldBehavior, "DamageResponse.ModifyLimitVitalMaxFractionArray[" + IntToString(0) + "]", lv_launchPlayer);
            lv_amount = Round((lv_amount * UnitGetPropertyFixed(lv_targetUnit, c_unitPropLifeMax, c_unitPropCurrent)));

mods/heroesdata.stormmodbase.stormdata/TriggerLibs/UILib.galaxy:11704

        if ((Round(CatalogFieldValueGetAsFixed(c_gameCatalogBehavior, lv_shieldBehavior, "DamageResponse.ModifyLimitVitalMaxFractionArray[" + IntToString(2) + "]", lv_launchPlayer)) <= 0.0)) {
            lv_amount = CatalogFieldValueGetAsFixed(c_gameCatalogBehavior, lv_shieldBehavior, "DamageResponse.ModifyLimitVitalMaxFractionArray[" + IntToString(0) + "]", lv_launchPlayer);
            lv_amount = Round((lv_amount * UnitGetPropertyFixed(lv_targetUnit, c_unitPropLifeMax, c_unitPropCurrent)));
        }
        else {

mods/heroesdata.stormmodbase.stormdata/TriggerLibs/UILib.galaxy:11708

        else {
            lv_amount = CatalogFieldValueGetAsFixed(c_gameCatalogBehavior, lv_shieldBehavior, "DamageResponse.ModifyLimitVitalMaxFractionArray[" + IntToString(2) + "]", lv_launchPlayer);
            lv_amount = Round((lv_amount * UnitGetPropertyFixed(lv_targetUnit, c_unitPropEnergyMax, c_unitPropCurrent)));
        }
    }

mods/heroesdata.stormmodbase.stormdata/TriggerLibs/UILib.galaxy:11712

    }
    else {
        lv_amount = Round(CatalogFieldValueGetAsFixed(c_gameCatalogBehavior, lv_shieldBehavior, "DamageResponse.ModifyLimit", lv_launchPlayer));
    }
    if ((lv_amount <= 0.0)) {

mods/novastoryassets.sc2modbase2.sc2maps/maps/campaign/nova/nova04.sc2map/MapScript.galaxy:1066

    }
    else if ((UnitGroupCount(lv_nearValidUnits, c_unitCountAlive) > 0)) {
        lv_roundedCrawlerLocation = Point(Round(PointGetX(UnitGetPosition(lp_sporeCrawler))), Round(PointGetY(UnitGetPosition(lp_sporeCrawler))));
        lv_x = -2;
        for ( ; ( (auto968B5FCE_ai >= 0 && lv_x <= auto968B5FCE_ae) || (auto968B5FCE_ai < 0 && lv_x >= auto968B5FCE_ae) ) ; lv_x += auto968B5FCE_ai ) {

mods/novastoryassets.sc2modbase2.sc2maps/maps/campaign/nova/nova04.sc2map/MapScript.galaxy:1066

    }
    else if ((UnitGroupCount(lv_nearValidUnits, c_unitCountAlive) > 0)) {
        lv_roundedCrawlerLocation = Point(Round(PointGetX(UnitGetPosition(lp_sporeCrawler))), Round(PointGetY(UnitGetPosition(lp_sporeCrawler))));
        lv_x = -2;
        for ( ; ( (auto968B5FCE_ai >= 0 && lv_x <= auto968B5FCE_ae) || (auto968B5FCE_ai < 0 && lv_x >= auto968B5FCE_ae) ) ; lv_x += auto968B5FCE_ai ) {

mods/novastoryassets.sc2modbase3.sc2maps/maps/campaign/nova/nova09.sc2map/MapScript.galaxy:4884

        else {
            if ((AbsF((PointGetFacing(PointFromId(599)) - UnitGetFacing(gv_xanthos))) > 5.0)) {
                UnitIssueOrder(gv_xanthos, OrderTargetingPoint(AbilityCommand("move", 4), PointWithOffsetPolar(PointFromId(599), 1.0, Round(PointGetFacing(PointFromId(599))))), c_orderQueueReplace);
            }
            else {

mods/novastoryassets.sc2mod/base2.sc2maps/maps/campaign/nova/nova04.sc2mapMapScript.galaxy:1066

    }
    else if ((UnitGroupCount(lv_nearValidUnits, c_unitCountAlive) > 0)) {
        lv_roundedCrawlerLocation = Point(Round(PointGetX(UnitGetPosition(lp_sporeCrawler))), Round(PointGetY(UnitGetPosition(lp_sporeCrawler))));
        lv_x = -2;
        for ( ; ( (auto968B5FCE_ai >= 0 && lv_x <= auto968B5FCE_ae) || (auto968B5FCE_ai < 0 && lv_x >= auto968B5FCE_ae) ) ; lv_x += auto968B5FCE_ai ) {

mods/novastoryassets.sc2mod/base2.sc2maps/maps/campaign/nova/nova04.sc2mapMapScript.galaxy:1066

    }
    else if ((UnitGroupCount(lv_nearValidUnits, c_unitCountAlive) > 0)) {
        lv_roundedCrawlerLocation = Point(Round(PointGetX(UnitGetPosition(lp_sporeCrawler))), Round(PointGetY(UnitGetPosition(lp_sporeCrawler))));
        lv_x = -2;
        for ( ; ( (auto968B5FCE_ai >= 0 && lv_x <= auto968B5FCE_ae) || (auto968B5FCE_ai < 0 && lv_x >= auto968B5FCE_ae) ) ; lv_x += auto968B5FCE_ai ) {

mods/novastoryassets.sc2mod/base3.sc2maps/maps/campaign/nova/nova09.sc2mapMapScript.galaxy:4884

        else {
            if ((AbsF((PointGetFacing(PointFromId(599)) - UnitGetFacing(gv_xanthos))) > 5.0)) {
                UnitIssueOrder(gv_xanthos, OrderTargetingPoint(AbilityCommand("move", 4), PointWithOffsetPolar(PointFromId(599), 1.0, Round(PointGetFacing(PointFromId(599))))), c_orderQueueReplace);
            }
            else {

mods/starcoop/starcoop.sc2modbase.sc2data/LibCOMI.galaxy:5540

    if ((libCOOC_gf_CC_CommanderLevel(lp_mengskPlayer, "TerranMengsk") >= 5)) {
        libCOMI_gv_cM_Mengsk_EnergyRegenRoyalGuard = (lv_energyregenperroyalguardsupplylevel * libCOMI_gf_CM_Mengsk_SupplyLevel(libCOMI_gv_cM_Mengsk_VeteranUnits));
        lv_roundeddisplay = Round(libCOMI_gv_cM_Mengsk_EnergyRegenRoyalGuard);
        libNtve_gf_CatalogFieldValueSetAsReal(c_gameCatalogEffect, "MengskTopBarEnergyRegenRoyalGuardDummy", "Amount", lp_mengskPlayer, lv_roundeddisplay);
    }

mods/starcoop/starcoop.sc2modbase.sc2data/LibCOMI.galaxy:5564

    if ((libCOOC_gf_CC_CommanderLevel(lp_mengskPlayer, "TerranMengsk") >= 5)) {
        libCOMI_gv_cM_Mengsk_EnergyRegenTrooper = (lv_energyregenperpropagandaunit * UnitGroupCount(libCOMI_gv_cM_Mengsk_PropagandaUnits, c_unitCountAlive));
        lv_roundeddisplay = Round(libCOMI_gv_cM_Mengsk_EnergyRegenTrooper);
        libNtve_gf_CatalogFieldValueSetAsReal(c_gameCatalogEffect, "MengskTopBarEnergyRegenTrooperDummy", "Amount", lp_mengskPlayer, lv_roundeddisplay);
    }

mods/starcoop/starcoop.sc2modbase.sc2data/LibCOMI.galaxy:22170

    }

    lv_xp = MaxF(Round((lv_xp / lv_veterancount)), lv_minimumearnedxp);
    auto9DCFEB60_g = lv_veteranunits;
    auto9DCFEB60_u = UnitGroupCount(auto9DCFEB60_g, c_unitCountAll);

mods/starcoop/starcoop.sc2modbase.sc2data/LibCOMI.galaxy:30303

        if (lv_itPlayer < 0) { break; }
        lv_reviveTimer[lv_itPlayer] = UnitBehaviorDuration(libCOMI_gv_cM_HeroReviver[lv_itPlayer], "NovaReviveTimer");
        lv_totalBuybackCost = (Round(lv_reviveTimer[lv_itPlayer]) * lv_reviveCostPerSecond);
        CatalogFieldValueSet(c_gameCatalogAbil, "NovaReviveInstantBuyback", "Cost[" + IntToString(0) + "].Resource[" + IntToString(c_resourceTypeMinerals) + "]", lv_itPlayer, FixedToString(lv_totalBuybackCost, 0));
    }

mods/starcoop/starcoop.sc2modbase.sc2data/LibCOOC.galaxy:486

    }

    lv_rewards = FixedToInt(Round(((IntToFixed(libCOOC_gf_MissionObjectiveProgress(lp_objective))*IntToFixed(UserDataGetInt("Experience", "GameValues", "BonusObjExperience", 1))*UserDataGetFixed("MissionObjective", libCOOC_gf_CS_ObjectiveUserDataInstance(lp_objective), "XPMultiplier", 1))/IntToFixed(libCOOC_gf_MissionObjectiveItemCount(lp_objective)))));
    return lv_rewards;
}