# Trunc (Integer)

Grammar — Trunc(x)
FlagsNative | Function

Strips off the fractional portion of a real.

# Arguments

  • fixed — Value

Returns — int

native int TruncI(fixed x);

Category: Math / Arithmetic

# Examples

# mods/heroesdata.stormmod

AILib.galaxy

// L2487
TruncI(lv_aiThreatValue)
// L2541
TruncI(lv_aiThreatValue)

# mods/heroesmapmods/battlegroundmapmods/braxisholdout.stormmod

LibSCHO.galaxy

// L4046
TruncI(libSCHO_gv_mMHO_ControlBeaconProgressIncrement_C)
// L4067
TruncI(libSCHO_gv_mMHO_ControlBeaconProgressIncrement_C)

# mods/starcoop/starcoop.sc2mod

LibCOMI.galaxy

// L2643
TruncI((lv_unitTypePercentBase[lv_unitPercentBaseIter] * lv_waveResourceTotal / UnitTypeGetCost(lv_unitTypesForWave[lv_unitPercentBaseIter], c_unitCostSumMineralsVespene)))
// L2647
TruncI((lv_unitTypePercentBase[lv_unitPercentBaseIter] * lv_waveResourceTotal / 125.0))
// L2999
TruncI((lv_unitTypePercentBase[lv_unitPercentBaseIter] * lv_waveResourceTotal / UnitTypeGetCost(lv_unitTypesForWave[lv_unitPercentBaseIter], c_unitCostSumMineralsVespene)))
// L3003
TruncI((lv_unitTypePercentBase[lv_unitPercentBaseIter] * lv_waveResourceTotal / 125.0))
// L15308
TruncI((lv_biomassCountStoredTemp / 100))
// L15310
TruncI((lv_biomassCountStoredTemp / 10))
// L15320
TruncI((lv_biomassCountStoredTemp / 100))
// L15322
TruncI((lv_biomassCountStoredTemp / 10))