GSC reference › Built-in
StrIsFloat()
Built-in (engine)
Server + client
Utility
Check if a string is a float.
Signature
StrIsFloat(<string>)
Parameters
| Name | Required? | Details |
|---|---|---|
| string | Required | The string to check. |
Example (from Treyarch's docs)
StrIsFloat( "1.2" ); // true
Real uses in BO3's scripts
Called 1 time in the decompiled scripts. A few, zombies first:
- scripts/shared/table_shared.gsc, line 74
else if(strisfloat(value))
Related built-ins
- GetDvarFloat()Gets the value of a dvar.
- IsFloat()Checks whether this entity/variable is a float
- RandomFloatRange()Returns a random floating point number r, where min <= r < max
- RandomFloat()Returns a random floating point number r, where 0 <= r < max
- MapFloat()Returns a lerped value between <from> and <to> based on <time>.
- Float()Casts a string or an integer to a float
- LerpFloat()Returns a lerped value between <from> and <to> based on <time>
- array()Create an array
- Assert()Assert that the given statement is correct.
- GetDvarInt()Gets the value of a dvar.
- IsArray()Checks whether this entity/variable is an array
- GetDvarString()Gets the value of a dvar.
New to GSC?
Start with the basics, or paste a compile error to get the fix.
Built-in descriptions, parameters and examples come from Treyarch's BO3 mod tools docs. Usage links point at shiversoftdev/t7-source (decompiled BO3 scripts).