Sasu Posted January 29, 2015 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! State: Inactive
DNL291 Posted January 29, 2015 Posted January 29, 2015 It should work: string.format("%02d:0%.1f", 0, 0.2) Please do not PM me with scripting related question nor support, use the forums instead.
Sasu Posted January 29, 2015 Author 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! State: Inactive
DNL291 Posted January 29, 2015 Posted January 29, 2015 string.format("%02d:%04.1f", 0, 0.2) ? Please do not PM me with scripting related question nor support, use the forums instead.
Sasu Posted January 29, 2015 Author Posted January 29, 2015 Works! Thank you very much. State: Inactive
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