03.06.2016, 11:05
Hi,
I have float number how get what number after .?
2555.140211
How get that here is
140211
I have float number how get what number after .?
2555.140211
How get that here is
140211
new
Float: a = 2555.140211,
b[16],
c;
format(b, sizeof b, "%f", a);
sscanf(b, "p<.>{i}i", c);
// c = 140211
new
Float: a = 2555.140211,
b[16],
c;
a = floatfract(a); // a = 0.140211
format(b, sizeof b, "%f", a);
c = strval(b[2]);
// string b[2] is "140211"
// c = 140211
abs(floatround(value * 100.00) - (floatround(value, floatround_tozero) * 100));
abs(value) { return ((value < 0) ? (-value) : (value)); }