Shortening big numbers

Hi!

I’m creating a face on which I want to have reading of milliseconds in this format: “.124”
I can get milliseconds as parts of second with “(#Dsm#-#Ds#)” and it even have “.” in it but…
It also have 0 in front of it and gives me way to many digits (16 and I want only 3).

So my question is: how to show only 3 digits after “.”; and how to hide integers from number (not replace them with 0, but hide all together)?

Thanks for any tips.

1 Like

Multiply to get the number of digits you want to the left of the decimal and then strip off the rest of with round. In your case, this should work: (round((#Dsm#-#Ds#)*1000)) That gets you the separate milliseconds. From that, you can either add it on by using a separate text tag or divide back by 1000 and add it to the seconds.

2 Likes

Thanks!

I used “.$(round((#Dsm#-#Ds#)*1000))>99?(round((#Dsm#-#Ds#)*1000)):0(round((#Dsm#-#Ds#)*1000))$” and it works as I wanted.

2 Likes

Thank you both
I allow myself to correct Mellin’s expression:

.$(round((#Dsm#-#Ds#)*1000))>99?(round((#Dsm#-#Ds#)*1000)):0(round((#Dsm#-#Ds#)*1000))$

It lacks the " * " in front of the first two 1000, this is due to the formatting of the text :wink:

2 Likes