Skip to content

float_int

Floating Point Numbers (XFL)
  • Left shift (multiply by 10) the XFL by the number of specified decimal places
  • Convert the resulting XFL to an integer, discarding any remainder
  • Return the integer
int64_t float_int (
int64_t float1,
uint32_t decimal_places,
uint32_t absolute
);
int64_t drops =
float_int(xahbalance, 6, 0);
NameTypeDescription
float1int64_tAn XFL floating point enclosing number representing the first operand to the addition
decimal_placesuint32_tThe number of places to shift the decimal to the right before computing the floor of the floating point.
absoluteuint32_tIf 1 also take the absolute of the value before returning it.
TypeDescription
int64_t

The computed positive integer

If negative, an error:
INVALID_FLOAT
- one of the supplied parameters was not a valid XFL enclosing number

INVALID_ARGUMENT
- attempted to specify more than 15 decimal places.

CANT_RETURN_NEGATIVE
- attempted to return a negative integer but this is not allowed, use absolute = 1