WalkinG Posted January 29, 2017 Share 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. Link to comment
Mr.Loki Posted January 29, 2017 Share Posted January 29, 2017 https://wiki.multitheftauto.com/wiki/ConvertNumber Link to comment
Hoffmann Posted January 29, 2017 Share 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! Link to comment
WalkinG Posted January 30, 2017 Author Share Posted January 30, 2017 Thank you very much for helping me. Link to comment
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