playMaker

Author Topic: convert int to string formats help  (Read 518 times)

andyandyandy

  • Beta Group
  • Junior Playmaker
  • *
  • Posts: 63
convert int to string formats help
« on: March 31, 2021, 05:14:07 PM »
If I have over 1million value as INT and I wanted to convert it to string, is there any format I can use where it will format it to the first million digit and then one decimal value as a 100k.

For example int value 2,943,000. Convert to string: "2.9 million"
is there a format for this on the convert int to string action?

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: convert int to string formats help
« Reply #1 on: April 01, 2021, 09:55:17 AM »
Hi.
I made a 'Cookie Clicker' before but i used floats instead of ints.

and for displaying i checked for example if greater than 999,999 then divide by 1.000000 then use format 0.0 and build string to show M or million behind it.