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: 6518
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 957 times
Been thanked: 1883 times

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

Postby TJ » 30 Sep 2011

vking wrote: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
These users thanked the author TJ for the post (total 2):
JoshMHenry MultiСharts

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: 6518
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 957 times
Been thanked: 1883 times

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

Postby TJ » 30 Sep 2011

vking wrote: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
keyword categories.gif (11.07 KiB) Viewed 258 times


Return to “MultiCharts”