float to num
Hello,
how can I turn a float number to a normal number example: I wanna turn a float : 1.65853543 to a number : 1 or 2 doesnt matter how it rounds off. I was thinking about using float_to_str and then str_to_num. wil this give me the desired effect that i need? |
Re: float to num
|
Re: float to num
float() converts int to float.
floatround() converts float to int. num_to_str() converts int to string. str_to_num() converts string to int. float_to_str() converts float to string. str_to_float() converts string to float. |
Re: float to num
so
PHP Code:
or wil it just work away the comma so that g_iNum1 would be 3642148 ? |
Re: float to num
It will return 4.
floatround_round rounds to nearest int. (3.642148 -> 4) floatround_floor rounds to nearest smaller int. (3.642148 -> 3) floatround_ceil rounds to nearest larger int. (3.642148 -> 4) (useful for 3.22 for example) floatround_zero rounds to nearest to 0 int. (3.642148 -> 3) (useful for negative values) |
Re: float to num
ok thx, i also just tested it out.
works perfect :) |
| All times are GMT -4. The time now is 00:30. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.