Join Slack
Powered by
Is this the right way to convert float to string i...
# announcements
a
Alexander Suraphel
04/05/2020, 10:10 PM
Is this the right way to convert float to string in kotlin?
Copy code
8938.3f.toString()
c
Chris Cunningham
04/06/2020, 12:09 AM
for basic use that will do the job
Chris Cunningham
04/06/2020, 12:12 AM
could also do something like this, if you only wanted to display a limited number of decimals or apply a other type of formatting.
Copy code
"%.2f".format(8938.598f)
a
Alexander Suraphel
04/06/2020, 6:14 AM
Nice thanks
@Chris Cunningham
9
Views
Open in Slack
Previous
Next