Fload display
How to display a float with only 2 decimals ?
Code:
new const XDAMAGE[11][] = { |
Re: Fload display
I think you are the first person who has ever asked this, so it would be useless trying to search.
I hope someone has the answer though. |
Re: Fload display
If you want to show value from your array, you don't need to convert to float.
ShowSyncHudMsg(id, g_HudMsgr, "Damage x %s", XDAMAGE[g_level[id]]) |
Re: Fload display
10x arkshine, yes it was just a matter of display and that does the trick. Simple solutions are the best :))
|
Re: Fload display
You call that simple solution? Storing float damage multipliers as strings? lol
PHP Code:
|
Re: Fload display
what's wrong with that ? It's just for displaying that float as a string.
why should i do an extra calculation when it's just as simple as that ? |
Re: Fload display
Redundant code. Although you say it's just for displaying, aren't you using float multiplier to change damage in your plugin? Then why do you add unnecessary array of strings when you can use the same thing for multiplying damage and displaying multiplier value? Also imagine you want to edit the multipliers (you would have to edit every value in array to match actual multiplier - waste of time).
|
Re: Fload display
Oh, i see what you mean. Thanks for helping ! :)
|
| All times are GMT -4. The time now is 20:37. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.