Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to cast a string into a float?

 
George Ren
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to make a string like "123" to a float number like 123.000. How can I achieve this? Thanks for help!

Regards,
Have a nice day!
 
jim gotti
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Float.parseFloat(String) may help?


If you need to keep the precision of 3 decimals this thread may help
 
George Ren
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot. It does work
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic