Print(Price) seen only as 2 decimal places instead of 4

Questions about MultiCharts and user contributed studies.
User avatar
t-rader
Posts: 139
Joined: 02 Feb 2011
Location: Australia
Has thanked: 11 times
Been thanked: 27 times

Print(Price) seen only as 2 decimal places instead of 4

Postby t-rader » 02 Feb 2011

Hi

I'm a newby to Multicharts and currently have a hurdle which I'm stuck on.
When I am in the Powerlanguage Editor and I'm using the print command, I notice that the price is presented only to 2 decimal places instead of 4. e.g.
Print(Price) - is outputting 1.23 instead of 1.2398.

Anyone know why?

Regards
T-Rader

Roumeau
Posts: 18
Joined: 18 Nov 2010

Re: Print(Price) seen only as 2 decimal places instead of 4

Postby Roumeau » 02 Feb 2011

Hello, you got to:

Expression:C:D
Where: C - minimum number of characters
D - number of decimal places

example:
Print(1.555555:6:3); will print 1.556 in the PowerLanguage Editor Output Log, with one
leading space inserted

it is from the multicharts.pdf

janus
Posts: 835
Joined: 25 May 2009
Has thanked: 63 times
Been thanked: 104 times

Re: Print(Price) seen only as 2 decimal places instead of 4

Postby janus » 02 Feb 2011

Alternatively:

print ( NumToStr(n,4) );


Return to “MultiCharts”