# Convert Real To Integer
Grammar — Integer(val|Real)
Flags —Native
|Function
Converts a real value into an integer value.
# Arguments
fixed
— Value
Returns — int
native int FixedToInt(fixed x);
# Related
Category: Conversion / Basic Conversions
- [F] —
text
— Convert String To Text — ( StringToText ) - [F] —
string
— Convert Game Link To String — ( ) - [F] —
string
[ gamelink ] — Convert String To Game Link — ( ) - [F] —
string
[ catalogentry ] — Convert String To Catalog Entry — ( ) - [F] —
string
[ reference ] — Convert String To Catalog Reference — ( ) - [F] —
string
[ catalogfieldname ] — Convert String To Catalog Field Name — ( ) - [F] —
string
[ catalogfieldpath ] — Convert String To Catalog Field Path — ( ) - [F] —
string
[ catalogscope ] — Convert String To Catalog Scope — ( ) - [F] —
string
— Convert Catalog Entry To String — ( ) - [F] —
string
— Convert Catalog Reference To String — ( ) - [F] —
string
[ reference ] — Convert Catalog Reference (Any -> Numeric) — ( ) - [F] —
string
[ reference ] — Convert Catalog Reference (Any -> Upgrade) — ( ) - [F] —
string
[ reference ] — Convert Catalog Reference (Upgrade -> Any) — ( ) - [F] —
string
[ reference ] — Convert Catalog Reference (Numeric -> Any) — ( ) - [F] —
string
— Convert Catalog Field Name To String — ( ) - [F] —
string
— Convert Catalog Field Path To String — ( ) - [F] —
string
— Convert Catalog Scope To String — ( ) - [F] —
string
[ filepath ] — Convert String To Image File — ( ) - [F] —
string
[ filepath ] — Convert String To Movie File — ( ) - [F] —
string
[ filepath ] — Convert String To Cutscene File — ( ) - [F] —
string
— Convert Conversation State Index To String — ( ) - [F] —
string
[ convstateindex ] — Convert String To Conversation State Index — ( ) - [F] —
string
— Convert User Data Instance To String — ( ) - [F] —
string
[ userinstance ] — Convert String To User Data Instance — ( ) - [F] —
fixed
— Convert String To Real — ( StringToFixed ) - [F] —
int
— Convert String To Integer — ( StringToInt ) - [F] —
abilcmd
— Convert String To Ability Command — ( StringToAbilCmd ) - [F] —
text
— Convert Real To Text — ( FixedToText ) - [F] —
text
— Convert Real To Text (Advanced) — ( FixedToTextAdvanced ) - [F] —
string
— Convert Real To String — ( FixedToString ) - [F] —
int
— Convert Real To Integer — ( FixedToInt ) - [F] —
text
— Convert Integer To Text — ( IntToText ) - [F] —
string
— Convert Integer To String — ( IntToString ) - [F] —
fixed
— Convert Integer To Real — ( IntToFixed ) - [F] —
text
— Convert Boolean To Text — ( libNtve_gf_ConvertBooleanToText ) - [F] —
int
— Convert Boolean To Integer — ( BoolToInt ) - [F] —
string
— Convert Boolean To String — ( libNtve_gf_ConvertBooleanToString ) - [F] —
bool
— Convert String To Boolean — ( libNtve_gf_ConvertStringToBoolean ) - [F] —
string
— Convert Point To String — ( libNtve_gf_ConvertPointToString ) - [F] —
point
— Convert String To Point — ( libNtve_gf_ConvertStringToPoint ) - [F] —
string
— Convert Image To String — ( ) - [F] —
int
— Convert Game User To Integer — ( ) - [F] —
text
— Format Number — ( FormatNumber ) - [F] —
text
— Format Duration — ( FormatDuration )
# Examples
# campaigns/liberty.sc2campaign
// L1174
FixedToInt(TimerGetRemaining(gv_mainTimer))
// L1292
FixedToInt(TimerGetRemaining(gv_mainTimer))
// L1372
FixedToInt(TimerGetRemaining(gv_mainTimer))
// L3372
FixedToInt((IntToFixed(lp_points) * (1.0 + (IntToFixed(gv_repeatTimes) * gv_c_ScoreBonus))))
// L3492
FixedToInt((IntToFixed((lv_shotDownTotal * 100)) / IntToFixed(gv_levelTotalEnemy)))
// L3526
FixedToInt((IntToFixed((lv_pickupTotal * 100)) / IntToFixed(gv_levelTotalPowerups)))
// L4842
FixedToInt(((IntToFixed(lv_deadInterceptorCount) + 1.0) * 0.666))
// L5846
FixedToInt((180.0 / lv_angleDeltaBetweenShots))
// L6332
FixedToInt((lv_shootingInterval + RandomFixed(-10.0, 10.0)))
// L6860
FixedToInt((lv_waveInfo.lv_patternParam5 / AbsF(lv_angleInterval)))
// L8073
FixedToInt((IntToFixed(gv_bossHPBarInnerWidth) * ((UnitGetPropertyFixed(gv_boss, c_unitPropLife, c_unitPropCurrent) + UnitGetPropertyFixed(gv_boss, c_unitPropShields, c_unitPropCurrent)) / (UnitGetPropertyFixed(gv_boss, c_unitPropLifeMax, c_unitPropCurrent) + UnitGetPropertyFixed(gv_boss, c_unitPropShieldsMax, c_unitPropCurrent)))))
// L8142
FixedToInt((IntToFixed(gv_unitHPBarInnerWidth) * ((UnitGetPropertyFixed(gv_unitHPBarUnit, c_unitPropLife, c_unitPropCurrent) + UnitGetPropertyFixed(gv_unitHPBarUnit, c_unitPropShields, c_unitPropCurrent)) / (UnitGetPropertyFixed(gv_unitHPBarUnit, c_unitPropLifeMax, c_unitPropCurrent) + UnitGetPropertyFixed(gv_unitHPBarUnit, c_unitPropShieldsMax, c_unitPropCurrent)))))
// L2496
FixedToInt(UnitGetCustomValue(lv_pickedUnit, 0))
// L1885
FixedToInt(UnitGetCustomValue(EventUnit(), 2))
// L1206
FixedToInt(UnitGetPropertyFixed(gv_purifier, c_unitPropLifeMax, c_unitPropCurrent))
// L1209
FixedToInt(UnitGetPropertyFixed(gv_purifier, c_unitPropLifeMax, c_unitPropCurrent))
// L1210
FixedToInt(UnitGetPropertyFixed(gv_purifier, c_unitPropLife, c_unitPropCurrent))
// L1238
FixedToInt(UnitGetPropertyFixed(gv_purifier, c_unitPropLife, c_unitPropCurrent))
// L1296
FixedToInt(TimerGetRemaining(gv_poweringUpTime))
// L1396
FixedToInt(TimerGetRemaining(gv_poweringUpTime))
// L1506
FixedToInt(TimerGetRemaining(gv_poweringUpTime))
// L1620
FixedToInt(TimerGetRemaining(gv_poweringUpTime))
// L1727
FixedToInt(TimerGetRemaining(gv_poweringUpTime))
// L1508
FixedToInt(UnitGetCustomValue(EventUnit(), 1))
// L1564
FixedToInt(UnitGetCustomValue(EventUnitProgressUnit(), 1))
// L1665
FixedToInt(UnitGetCustomValue(EventUnit(), 1))
// L2063
FixedToInt(UnitGetCustomValue(autoB51C2030_var, (ge_UnitData_udEggType)))
// L2065
FixedToInt(UnitGetCustomValue(autoB51C2030_var, (ge_UnitData_udEggColony)))
// L2148
FixedToInt(UnitGetCustomValue(auto499A4BF2_var, 0))
// L2149
FixedToInt(UnitGetCustomValue(auto499A4BF2_var, 0))
// L2155
FixedToInt(UnitGetCustomValue(auto499A4BF2_var, 0))
// L4319
FixedToInt(gv_trainWaveWait)
// L4335
FixedToInt(gv_trainWaveWait)
// L4348
FixedToInt(gv_trainWaveWait)
// L4362
FixedToInt(gv_trainWaveWait)
// L4374
FixedToInt(gv_trainWaveWait)
// L4381
FixedToInt(gv_trainWaveWait)
// L4389
FixedToInt(gv_trainWaveWait)
// L1269
FixedToInt(gv_odinCurrentHealth)
// L1270
FixedToInt(UnitGetPropertyFixed(gv_odin, c_unitPropLife, c_unitPropCurrent))
// L2498
FixedToInt(UnitGetCustomValue(lp_unit, (ge_CustomDataIndex_CustomDataIndexClickableLock)))
// L2503
FixedToInt(UnitGetCustomValue(lp_unit, (ge_CustomDataIndex_CustomDataIndexClickableRoom)))
// L9588
FixedToInt(UnitGetCustomValue(lv_hotspot, (ge_CustomDataIndex_CustomDataIndexFlashingData)))
// L9603
FixedToInt(UnitGetCustomValue(lp_unit, (ge_CustomDataIndex_CustomDataIndexFlashingData)))
// L9891
FixedToInt(UnitGetCustomValue(lp_unit, (ge_CustomDataIndex_CustomDataIndexFlashingData)))
// L9998
FixedToInt((1600.0 * lv_gradientWidthPercent))
// L10013
FixedToInt(ConversationDataStateFixedValue(lp_convoID, "Anchor"))
// L10013
FixedToInt(ConversationDataStateFixedValue(lp_convoID, "OffsetX"))
// L10013
FixedToInt(ConversationDataStateFixedValue(lp_convoID, "OffsetY"))
// L10013
FixedToInt(ConversationDataStateFixedValue(lp_convoID, "Width"))
// L295
FixedToInt(UnitGetCustomValue(UnitGroupRandomUnit(lv_terrazineGroup, c_unitCountAlive), 0))
// L303
FixedToInt(UnitGetCustomValue(UnitGroupRandomUnit(UnitGroup("TerrazineCanister", c_playerAny, RegionEntireMap(), UnitFilter(0, 0, (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0), c_unitCountAlive), 0))
// L497
FixedToInt(UnitGetCustomValue(auto96AA0583_var, 0))
// L502
FixedToInt(UnitGetCustomValue(auto96AA0583_var, 0))
// L533
FixedToInt(UnitGetCustomValue(auto7CD40DCB_var, 0))
// L538
FixedToInt(UnitGetCustomValue(auto7CD40DCB_var, 0))
// L568
FixedToInt(UnitGetCustomValue(lv_pickedUnit, 0))
// L608
FixedToInt(UnitGetCustomValue(lv_pickedUnit, 0))
// L618
FixedToInt(UnitGetCustomValue(lv_pickedUnit, 0))
// L1697
FixedToInt(UnitGetCustomValue(EventUnitTargetUnit(), 0))
// L111
FixedToInt(UnitGetPropertyFixed(UnitFromId(326), c_unitPropLifeMax, c_unitPropNormal))
// L4488
FixedToInt(UnitGetPropertyFixed(gv_tosh, c_unitPropLife, c_unitPropCurrent))
// L1818
FixedToInt(UnitGetPropertyFixed(gv_tHEONEDRILL, c_unitPropLife, c_unitPropNormal))
// L1819
FixedToInt(UnitGetPropertyFixed(gv_tHEONEDOOR, c_unitPropLife, c_unitPropCurrent))
// L2359
FixedToInt((lv_d / 5.0))
// L2520
FixedToInt(TimerGetRemaining(gv_kerriganSearchTimer))
// L1128
FixedToInt((((PointGetY(PointFromId(142)) - PointGetY(PointFromId(122))) / 3.5) - ModF((PointGetY(PointFromId(142)) - PointGetY(PointFromId(122))), 3.5)))
// L5782
FixedToInt(UnitGetCustomValue(auto937566B9_var, 0))
// L5783
FixedToInt(UnitGetCustomValue(auto937566B9_var, 0))
// L7291
FixedToInt(UnitGetPropertyFixed(gv_tHEONEBROODMOTHER, c_unitPropLifeMax, c_unitPropCurrent))
// L7292
FixedToInt(UnitGetPropertyFixed(gv_tHEONEBROODMOTHER, c_unitPropLife, c_unitPropCurrent))
// L7322
FixedToInt(UnitGetPropertyFixed(gv_tHEONEBROODMOTHER, c_unitPropLife, c_unitPropCurrent))
// L499
FixedToInt(UnitGetCustomValue(lp_spawner, 0))
// L510
FixedToInt(UnitGetCustomValue(lp_spawner, 0))
// L2790
FixedToInt(UnitGetCustomValue(EventUnit(), 0))
// L1203
FixedToInt(UnitAbilityGetCooldown(gv_artifact, "EnergyNova", "Abil/Supernova"))
// L1221
FixedToInt(UnitAbilityGetCooldown(gv_artifact, "EnergyNova", "Abil/Supernova"))
// L1807
FixedToInt((IntToFixed(lv_targetCount) * libNtve_gf_DifficultyValueFixed(0.5, 0.5, 0.6, 0.75)))
// L1880
FixedToInt((IntToFixed(lv_targetCount) * 0.8))
// L5325
FixedToInt(TimerGetRemaining(gv_protectArchiveTimer))
// L3372
FixedToInt((IntToFixed(lp_points) * (1.0 + (IntToFixed(gv_repeatTimes) * gv_c_ScoreBonus))))
// L3492
FixedToInt((IntToFixed((lv_shotDownTotal * 100)) / IntToFixed(gv_levelTotalEnemy)))
// L3526
FixedToInt((IntToFixed((lv_pickupTotal * 100)) / IntToFixed(gv_levelTotalPowerups)))
// L4842
FixedToInt(((IntToFixed(lv_deadInterceptorCount) + 1.0) * 0.666))
// L5846
FixedToInt((180.0 / lv_angleDeltaBetweenShots))
// L6332
FixedToInt((lv_shootingInterval + RandomFixed(-10.0, 10.0)))
// L6860
FixedToInt((lv_waveInfo.lv_patternParam5 / AbsF(lv_angleInterval)))
// L8073
FixedToInt((IntToFixed(gv_bossHPBarInnerWidth) * ((UnitGetPropertyFixed(gv_boss, c_unitPropLife, c_unitPropCurrent) + UnitGetPropertyFixed(gv_boss, c_unitPropShields, c_unitPropCurrent)) / (UnitGetPropertyFixed(gv_boss, c_unitPropLifeMax, c_unitPropCurrent) + UnitGetPropertyFixed(gv_boss, c_unitPropShieldsMax, c_unitPropCurrent)))))
// L8142
FixedToInt((IntToFixed(gv_unitHPBarInnerWidth) * ((UnitGetPropertyFixed(gv_unitHPBarUnit, c_unitPropLife, c_unitPropCurrent) + UnitGetPropertyFixed(gv_unitHPBarUnit, c_unitPropShields, c_unitPropCurrent)) / (UnitGetPropertyFixed(gv_unitHPBarUnit, c_unitPropLifeMax, c_unitPropCurrent) + UnitGetPropertyFixed(gv_unitHPBarUnit, c_unitPropShieldsMax, c_unitPropCurrent)))))
// L2496
FixedToInt(UnitGetCustomValue(lv_pickedUnit, 0))
// L1885
FixedToInt(UnitGetCustomValue(EventUnit(), 2))
// L1206
FixedToInt(UnitGetPropertyFixed(gv_purifier, c_unitPropLifeMax, c_unitPropCurrent))
// L1209
FixedToInt(UnitGetPropertyFixed(gv_purifier, c_unitPropLifeMax, c_unitPropCurrent))
// L1210
FixedToInt(UnitGetPropertyFixed(gv_purifier, c_unitPropLife, c_unitPropCurrent))
// L1238
FixedToInt(UnitGetPropertyFixed(gv_purifier, c_unitPropLife, c_unitPropCurrent))
// L1296
FixedToInt(TimerGetRemaining(gv_poweringUpTime))
// L1396
FixedToInt(TimerGetRemaining(gv_poweringUpTime))
// L1506
FixedToInt(TimerGetRemaining(gv_poweringUpTime))
// L1620
FixedToInt(TimerGetRemaining(gv_poweringUpTime))
// L1727
FixedToInt(TimerGetRemaining(gv_poweringUpTime))