Jump to content

Simple string format


Sasu

Recommended Posts

Posted

Hello!

Can someone help me with my problem? I want to use string.format to get something like this: 00:00.2 but only I could get 00:0.2 with

string.format("%02d:%.1f", 0, 0.2) 

Thanks!

Posted

But if I do:

string.format("%02d:0%.1f", 0, 21.2) -> 00:021.2 

And I want get 00:21.2

Thanks for helping me!

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...