# How do I display X digits after . even if 0 (rvrs Zeropad?)

Get help using Construct 2

### » Sun Feb 15, 2015 5:19 pm

Hi,

I'm looking for the simplest way to display a constant number of digits on the display, also decimals.

"Zeropad" does the trick before the dot, but I need to fill up the decimals from behind. (The clock-solution does not work here, since there you always fill up zeroes from the left.)

Examples:

00.00 (= Returned Value: 0)
01.00 (= Returned Value: 1)
01.10 (= Returned Value: 1.1)
01.11 (= Returned Value: 1.11)

BEST would be a solution, where no calculation is needed (like Zeropad) to save CPU.

B
8
S
3
Posts: 197
Reputation: 1,207

### » Sun Feb 15, 2015 6:15 pm

Here's an example using the time expression:
B
71
S
22
G
279
Posts: 3,838
Reputation: 153,878

### » Sun Feb 15, 2015 10:54 pm

> @blackhornet

Thanks, but that does not help, as I described:

"The clock-solution does not work here, since there you always fill up zeroes from the left."
B
8
S
3
Posts: 197
Reputation: 1,207

### » Sun Feb 15, 2015 10:57 pm

Still, I just came to an idea: It might work if I do it for each digit! If no other solution comes up, I will try that. But maybe there is a simpler way?
B
8
S
3
Posts: 197
Reputation: 1,207

### » Sun Feb 15, 2015 11:01 pm

int(time) & "." & int(time*100)%100
B
71
S
22
G
279
Posts: 3,838
Reputation: 153,878

### » Sun Feb 15, 2015 11:19 pm

No there you have to count too much.. I now think of len(), i tried that, but that also needs a loop to fill up each missing character at the end with a 0.

Still looking for a more effective solution!
B
8
S
3
Posts: 197
Reputation: 1,207

### » Sun Feb 15, 2015 11:30 pm

> @blackhornet : ok man, I got it... thanx
B
8
S
3
Posts: 197
Reputation: 1,207