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 » 12 Jul 2018, 17:33

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: 6867
Joined: 14 Dec 2012, 00:25

Re: decimal numbers

Post by coppelia » 13 Jul 2018, 17:39

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 » 13 Jul 2018, 19:51

Hello,
thanks very much

Post Reply