playMaker

Author Topic: formating a float and converting  (Read 1777 times)

Splankton

  • Sr. Member
  • ****
  • Posts: 268
formating a float and converting
« on: June 20, 2014, 12:45:19 PM »
How can I format floats to ints like this-
0.342564 to 34
Or, 1.342564 to 134?
« Last Edit: June 20, 2014, 12:50:55 PM by Splankton »

Splankton

  • Sr. Member
  • ****
  • Posts: 268
Re: formating a float and converting
« Reply #1 on: June 20, 2014, 12:57:31 PM »
Its ok I've done it with Jean's ConvertSecondsToString, then converted the string to an int.

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 4000
  • Official Playmaker Support
    • LinkedIn
Re: formating a float and converting
« Reply #2 on: June 20, 2014, 02:02:37 PM »
You could also multiply by 100 then convert to int. Probably quicker than the string conversion...

Splankton

  • Sr. Member
  • ****
  • Posts: 268
Re: formating a float and converting
« Reply #3 on: June 20, 2014, 02:23:26 PM »
You could also multiply by 100 then convert to int. Probably quicker than the string conversion...

Yes, I'll give that way a go, thanks