Sasu Posted January 29, 2015 Share Posted January 29, 2015 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! Link to comment
DNL291 Posted January 29, 2015 Share Posted January 29, 2015 It should work: string.format("%02d:0%.1f", 0, 0.2) Link to comment
Sasu Posted January 29, 2015 Author Share Posted January 29, 2015 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! Link to comment
DNL291 Posted January 29, 2015 Share Posted January 29, 2015 string.format("%02d:%04.1f", 0, 0.2) ? Link to comment
Sasu Posted January 29, 2015 Author Share Posted January 29, 2015 Works! Thank you very much. Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now