help - to detect the last integer+decimal from price

Questions about MultiCharts and user contributed studies.
vking
Posts: 235
Joined: 21 May 2009
Has thanked: 51 times
Been thanked: 41 times

help - to detect the last integer+decimal from price

Postby vking » 30 Sep 2011

hello - anyone out there.

Is there any efficient way to calculate the last integer+decimals from the price?

for example:

1541.75 - should return 1.75
932.11 - should return 2.11
86.42 - should return 6.42

I tried different options - but have been running around to get this done efficiently.

Thanks in advance!!

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Re: help - to detect the last integer+decimal from price

Postby TJ » 30 Sep 2011

hello - anyone out there.

Is there any efficient way to calculate the last integer+decimals from the price?

for example:

1541.75 - should return 1.75
932.11 - should return 2.11
86.42 - should return 6.42

I tried different options - but have been running around to get this done efficiently.

Thanks in advance!!
divide the number by 10,

then use FracPortion to get the decimal portion,

then multiply it by 10 again.


QED

vking
Posts: 235
Joined: 21 May 2009
Has thanked: 51 times
Been thanked: 41 times

Re: help - to detect the last integer+decimal from price

Postby vking » 30 Sep 2011

Thanks TJ - Didn't know about the keyword - FracPortion :)

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Re: help - to detect the last integer+decimal from price

Postby TJ » 30 Sep 2011

Thanks TJ - Didn't know about the keyword - FracPortion :)
press [F1] and you will get to see the keywords by category

Image
Attachments
keyword categories.gif
(11.07 KiB) Downloaded 470 times


Return to “MultiCharts”