1LoL1 Posted August 29, 2017 Share Posted August 29, 2017 (edited) Please can anyone help me with this? i don't know how to unconvertnumber with "$" when it's money = "5,000,000" working but with $ not working.. money = "5,000,000$" function unconvertNumber ( number ) local result = number:gsub ( ",", "" ); return tonumber ( result ); end outputChatBox(unconvertNumber(money)) Edited August 29, 2017 by 1LoL1 Link to comment
Rockyz Posted August 29, 2017 Share Posted August 29, 2017 try like this : function unconvertNumber ( number ) local result = number:gsub ( ',', '' ):gsub ( '%$', '' ); return tonumber ( result ); end Link to comment
1LoL1 Posted August 29, 2017 Author Share Posted August 29, 2017 2 minutes ago, #,+( _xiRoc[K]; > said: try like this : function unconvertNumber ( number ) local result = number:gsub ( ',', '' ):gsub ( '%$', '' ); return tonumber ( result ); end Thanks working. 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