Decimal places...removable?
I am currently working on a simple money-mod plugin, and I am using set_hudmessage and show_hudmessage to show how much money the person has. I have successfully setup how to display the money when it is givin to the player, but it is in a decimal and the decimal places values are huge.
What I mean is, in the show_hudmessage, when it draws it's like, "Current amount of money: 5.000000" I am just trying to get it so it just shows the "5" instead of the ".000000" after it... Any ideas how I would go about doing this? Here is how I'm doing the code... Code:
public display(id){Code:
new Float:money[33] = 0 |
You define money as a floating number thats why.
|
Oh you basterd.
Floats are used to display cents. If you just want dollars, use an int. |
Additionally, to convert a float to an integer you would use the floatround function, but I would just have the money variable be an integer in the first place unless you have a special reason that you need it as a float.
|
Alright so...
Code:
floatround ( Float:money[id], floatround_tozero )I am calling it inside a public, so the array section has the ID. Correct? Or would I just call it outside. |
The only reason you would want floats is for cents, and you just....removed the cents, so just use a damn integer.
|
here:
Code:
|
| All times are GMT -4. The time now is 19:18. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.