Get numbers after .
#6

Quote:
Originally Posted by Stinged
Посмотреть сообщение
If you want it as an integer, you can use this:
Код:
abs(floatround(value * 100.00) - (floatround(value, floatround_tozero) * 100));
Here's the function for abs:
Код:
abs(value)
{
	return ((value < 0) ? (-value) : (value));
}
No, this should not be used. You hardcoded it to only obtain two numbers of the fraction. Vince's solution is superior to this. If you really want it as an integer, cast floatfract's result to an int.
Reply


Messages In This Thread
Get numbers after . - by ScIrUsna - 03.06.2016, 11:05
Re: Get numbers after . - by F1N4L - 03.06.2016, 11:19
Re: Get numbers after . - by Konstantinos - 03.06.2016, 11:23
Re: Get numbers after . - by Vince - 03.06.2016, 14:21
Re: Get numbers after . - by Stinged - 03.06.2016, 15:45
Re: Get numbers after . - by Infinity - 03.06.2016, 16:00
Re: Get numbers after . - by Stinged - 03.06.2016, 16:01

Forum Jump:


Users browsing this thread: 1 Guest(s)