1 (edited by cleal 03/01/2019 04:53:03 pm)

Topic: function round2 on FA

Hi there,

FA have a function round2(), that function include this line "$delta = ($number < 0 ? -.0000000001 : .0000000001);"What is the function of that?

When I have to calculate grand total on gl_trans, my total is some like that this, 0.0000000005820766091346741.  ¿Why is not 0?

Thank you for your help...

cleal

Re: function round2 on FA

That is the php ternary operator.

Re: function round2 on FA

The round2 function helps to setup our decimal precision for amounts and prices.  So, here they are using to calculate the allowed rounding value with a limit of decimal points.

Subscription service based on FA
HRM CRM POS batch Themes

4 (edited by cleal 03/01/2019 05:11:21 pm)

Re: function round2 on FA

I understood ternary operator, but if format_number() or round() of php resolve that, ¿Why use it? and the other question ¿Why total amount of gl_trans is not 0?, my grand total is 0.0000000005820766091346741.

cleal