1. ## Converting

How can I convert an int like for example convery 10000 to 10k, convert 150000 to 150k 1000000 to 1m and etc.

How can I do this?

2. You want to take a int value, say 10000 and convert it to the String "10k".
Divide the int by 1000, convert the results to a String and concatenate a "k".
Same logic for "1m"

3. Originally Posted by Norm
You want to take a int value, say 10000 and convert it to the String "10k".
Divide the int by 1000, convert the results to a String and concatenate a "k".
Same logic for "1m"
How can I check whether or not it has a decimal? For example if it is 1500 it would say 1.5k but if it's 1000 it would say 1k.

EDIT:: nvm, figured it out! :)

Thank you!
Last edited by PhQ; 08-21-2011 at 05:26 PM.

4. How can I check
You could use the if statement to check the value of a variable.
You could check to see if there are remainders after a division by 1000 by using the % operator.

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•