# Trunc (Real)

Grammar — Trunc(x)
FlagsNative | Function

Strips off the fractional portion of a real.

# Arguments

  • fixed — Value

Returns — fixed

native fixed Trunc(fixed x);

Category: Math / Arithmetic

# Examples

mods/heroesdata.stormmodbase.stormdata/TriggerLibs/GameDataHelperLib.galaxy:9901

    lv_heroKilledUnit = libGame_gf_HeroKilledUnit();
    lv_wizenedDuelistStacks = IntToFixed(UnitBehaviorCount(libGame_gf_HeroKilledUnit(), "GreymaneWizenedDuelistQuestToken"));
    UnitSetTokenCount(lv_heroKilledUnit, "GreymaneWizenedDuelistQuestToken", Trunc((lv_wizenedDuelistStacks / 2.0)), lv_heroKilledUnit);
    UnitSetTokenCount(lv_heroKilledUnit, "GreymaneWizenedDuelistTokenCounter", 0.0, lv_heroKilledUnit);
    return true;

mods/heroesdata.stormmodbase.stormdata/TriggerLibs/GameDataHelperLib.galaxy:25561

    lv_siegeScore = PlayerScoreValueGetAsFixed(lv_player, "SiegeDamage");
    lv_modScore = (lv_siegeScore / 1000.0);
    lv_finalScore = (lv_rangedDamageDealtFraction + (Trunc(lv_modScore) / 100.0));

    // Actions

mods/heroesdata.stormmodbase.stormdata/TriggerLibs/HeroesLib.galaxy:2140

    }
    else {
        lv_levelDifferenceTrunc = AbsF(Trunc(lv_levelDifferenceReal));
    }
    lv_levelDifferenceModulo = AbsF(ModF(lv_levelDifferenceReal, 1.0));