Currency format?
#1

How do you display a string as proper currency format? I found an old include that wasn't supported anymore, and I couldn't find anything else. So what I mean is, if you read from a players file and it's "20000", how do you display it as "20,000" or "20,000.00" (currency format)?
Reply
#2

Theres a few recent includes for this, but you'd use a textdraw to add the decimal
Reply
#3

There could be an easier way, but i think you could use a classy way of calculating using modulus (%) and division for the ones, tens and hundreds by doing value % 1000, thousands, ten thousands and hundred thousands by floor rounding the result of value / 1000, and so on. Then just use format for each break, and calculate cents.. not sure how you would like that done but thats how I would do it. Could take a little bit of tweaking initially but yeah.
Reply
#4

Quote:
Originally Posted by PrawkC
Посмотреть сообщение
Theres a few recent includes for this, but you'd use a textdraw to add the decimal
Do you have the links to them? Only ones I can find are ones that give you ability to have cents, which isn't what I'm looking for, I'm looking for something to output a string as a currency format.
Reply
#5

https://sampforum.blast.hk/showthread.php?tid=38965&p=843781
Reply
#6

Thankyou! Just what I was looking for!
Reply
#7

Grim_ released something a couple months ago. It should be beneficial to you.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)