[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[amibroker] Re: Rounding to 4 dp



PureBytes Links

Trading Reference Links


Yep, I should have figured that one out - many thanks Arie. 

I suppose there isn't a function that can do this straight off?

--- In amibroker@xxxxxxxxxxxxxxx, "Arie Ellerbrak" 
<a.ellerbrak@xxxx> wrote:
> Sam,
> 
>  
> 
> Try this:
> 
>  
> 
> number = 0.03247;
> 
> divmul = 10000;
> 
>  
> 
> result = (round(number * divmul))/divmul;
> 
>  
> 
> Plot(result,"res",colorRed);
> 
>  
> 
>  
> 
> Regards,
> 
>  
> 
> Arie
> 
>  
> 
>   _____  
> 
> Van: qweds_560 [mailto:qweds_560@x...] 
> Verzonden: dinsdag 8 maart 2005 19:14
> Aan: amibroker@xxxxxxxxxxxxxxx
> Onderwerp: [amibroker] Rounding to 4 dp
> 
>  
> 
> 
> Hi All,
> 
> I want to round a number to nearest 4 decimal places e.g. 0.03247 
> would become 0.0325. I have looked at PREC but this will make the 
> number 0.0324. ROUND would make it 0 (rounds to nearest integer).
> 
> Any suggestions?
> 
> Cheers
> 
> Sam
> 
> 
> 
> 
> 
> Please note that this group is for discussion between users only.
> 
> To get support from AmiBroker please send an e-mail directly to 
> SUPPORT {at} amibroker.com
> 
> For other support material please check also:
> http://www.amibroker.com/support.html
> 
> 
> 
> 
> 
> 
> 
> 
> Yahoo! Groups Sponsor
> 
> 
> 
> ADVERTISEMENT
>  
> 
<http://us.ard.yahoo.com/SIG=129nbe37p/M=298184.6018725.7038619.30011
76/D=gr
> 
oups/S=1705632198:HM/EXP=1110392425/A=2593423/R=0/SIG=11el9gslf/*http
:/www.n
> etflix.com/Default?mqso=60190075> click here
> 
> 
>  
> <http://us.adserver.yahoo.com/l?
M=298184.6018725.7038619.3001176/D=groups/S=
> :HM/A=2593423/rand=544140425> 
> 
>  
> 
>   _____  
> 
> Yahoo! Groups Links
> 
> *	To visit your group on the web, go to:
> http://groups.yahoo.com/group/amibroker/
>   
> *	To unsubscribe from this group, send an email to:
> amibroker-unsubscribe@xxxxxxxxxxxxxxx
> <mailto:amibroker-unsubscribe@xxxxxxxxxxxxxxx?subject=Unsubscribe> 
>   
> *	Your use of Yahoo! Groups is subject to the Yahoo!
> <http://docs.yahoo.com/info/terms/>  Terms of Service.





------------------------ Yahoo! Groups Sponsor --------------------~--> 
What would our lives be like without music, dance, and theater?
Donate or volunteer in the arts today at Network for Good!
http://us.click.yahoo.com/Tcy2bD/SOnJAA/cosFAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to 
SUPPORT {at} amibroker.com

For other support material please check also:
http://www.amibroker.com/support.html

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/