playMaker

Author Topic: How to convert float to currency format?  (Read 356 times)

Silicon Power

  • Full Member
  • ***
  • Posts: 186
How to convert float to currency format?
« on: January 25, 2024, 08:57:28 AM »
Hi how can I convert a float value to currency format? For example I have a float variable around 100000 I need to show this value as 100,000

LeDisciple

  • Playmaker Newbie
  • *
  • Posts: 35
Re: How to convert float to currency format?
« Reply #1 on: February 02, 2024, 09:16:43 PM »
Hi,
I think Float always use a dot instead of a coma because of the decimal of a whole unit, so you need to convert to a string then string split or substring, add your coma and currency sign and rebuild. Like in my loading bar, I use a float text for the number and a string one for the %, and in my float loop I  format my text with "Float add" or "Float Multiply" as you wish like in the second pics to get the number of decimal I want but you can't have a coma. If you need to display whole number it's better to use INT instead.

Good luck!