Problem with the calculation of fields in form

Hi,

I have a problem when calculating operations division between two fields that result in many places. I use the following method for calculations:

{iva} = {pv} - ({pv}/1.16);
sc_format_num({iva}, ‘.’, ‘,’, 2, ‘N’, ‘1’, ‘’);
{total_op} = ({pv}/1.16)+{accesorios}+{impuesto_m}+{transfer}+{iva};
sc_format_num({total_op}, ‘.’, ‘,’, 2, ‘N’, ‘1’, ‘’);
{pendiente} = {total_op}-({a_cuenta}+{importe});
sc_format_num({pendiente}, ‘.’, ‘,’, 2, ‘N’, ‘1’, ‘’);

Sc_format_num expression does not return the correct number separated by thousands with rounding to 2 decimal places.

Any help?

Thanks in advance

Re: Problem with the calculation of fields in form

You may want to try using a direct PHP function if the sc_ function does not work.
http://php.net/manual/en/function.round.php
http://www.php.net/manual/en/function.number-format.php

Regards,
Scott.

Re: Problem with the calculation of fields in form

Thanks ScottMartin,

I worked perfectly with the PHP functions.

Again thank you very much,

Xayuso