Login | Register
Xan 6 Jun 2012
I have a 1180 ms duration and when I give a toStr it gives me obviously "1180ms". But I want to get "1second 180 ms" and if I have 61000 ms I want to display "1 min 1 second"
Is is possible to have it without not defining ad-hoc function?
andy 6 Jun 2012
Xan 9 Jun 2012
It does not works. It returns "1180 ms" result too.
StephenViles 10 Jun 2012
You could try porting one of the following from Ruby to Fantom:
You'll need to add code to handle milliseconds.
brian 11 Jun 2012
I really think Duration.toLocale will do what you want and it does proper localization. You have one specific example where it doesn't do exactly what you want, but that is because anything under 2sec is displayed in milliseconds. After that it starts rounding to the second. You should try it out with other values:
1day 3hr 12min
Xan 11 Jun 2012
Why under 2 sec this has this behaviour? Is it not logic?
Login or Register to Reply
Back | All Topics
Collapse All Expand All