Jump to content

tonumber problem with a 0


Recommended Posts

Posted

How I can attach the zero at the end?

tonumber automatically put the zero at the end away?

addCommandHandler ("ma",    function (player, cmd, zahl) 
outputChatBox (tonumber ("1".."."..zahl.."0")) 
end) 

so it must be look

/ma 1

result 1.10

but it looks like so

/ma 1

result 1.1

Has anybody a idea how I can solve this problem I need this for a money script?

Posted

-- # Server Side ~ 
addCommandHandler ('ma',    
    function ( _,_,zahl ) 
    if tonumber ( zahl ) then 
            outputChatBox ( ' 1.'..zahl..'0 ' ) 
    end 
end 
) 

Try it and tell me the results [ = .. ;) .

Posted

If you used tonumber i't will cancel the zero since it has no math value, try 3αsн8 αℓ7sαs's code it should work just fine .

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...