WalkinG Posted January 29, 2017 Posted January 29, 2017 I'm Brazilian and I speak little English, so I'm sorry if I explain it wrong I want to use commas and points in numbers but I do not know how, example a value that returns 150000 to be returned 1,500.00 Thank you, hope you help me.
Mr.Loki Posted January 29, 2017 Posted January 29, 2017 https://wiki.multitheftauto.com/wiki/ConvertNumber
Hoffmann Posted January 29, 2017 Posted January 29, 2017 function format(n) local left,num,right = string.match(n,'^([^%d]*%d)(%d*)(.-)$') return left..(num:reverse():gsub('(%d%d%d)','%1,'):reverse())..right end Example of using: outputChatBox("You have: $"..format(getPlayerMoney(player)), player) Also see http://lua-users.org/wiki/FormattingNumbers Good luck with numbers!
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now