decimal numbers

Typically: "How do I... ", "How can I... " questions
Post Reply
SIRX
Posts: 16
Joined: 17 Mar 2018, 15:22

decimal numbers

Post by SIRX »

Hi at all,
I have a problem about the number of digits. By this:

simUI.setLabelText(ui,4013,''..string.format("%.2f",DRWFL,true))

I write only 2 decimal digits as: 0.31 but I need to print 5 decimal digits...
Every advice is welcome.
thanks

coppelia
Site Admin
Posts: 10360
Joined: 14 Dec 2012, 00:25

Re: decimal numbers

Post by coppelia »

Hello,

what about writing 5 instead of 2??
Like:

Code: Select all

string.format("%.5f",1/3)
Cheers

SIRX
Posts: 16
Joined: 17 Mar 2018, 15:22

Re: decimal numbers

Post by SIRX »

Hello,
thanks very much

Post Reply