Topic: Decimal places of prices

Hello everyone,

Some of our items are purchased at a unit price that contains 3 decimal places. Changing decimal places of prices/amounts in display setup changes all values throughout the system, and doesn't look good when most of your numbers only need to be 2 places.

Is it possible to have 3 decimal places on the unit price line and then 2 for all the totals or something along these lines??

Thanks,
Mike

Re: Decimal places of prices

No it is not. Maybe you should consider selling your items in bigger pieces.

/Joe

Re: Decimal places of prices

Hi,

Unfortunately that is not an option. What if I created a seperate  price_decimal_format function and used that for unit price??


Mike

Re: Decimal places of prices

It almost sounds like a second setting would really be needed.

DECIMAL_PLACES_INTERNAL (accounting use) and DECIMAL_PLACES_EXTERNAL (seen by customers)

The problem is that at some point you need to actually round from 3 places to 2 places so that when you deal with
the ledger you never have partial pennies, invoices and payments need to be exact.

These 3 decimal place costed items, do you often sell 1 or 2?

sounds like money... are you dealing with 1/8ths?

tom

Re: Decimal places of prices

This would definitely be a useful amendment to the system. We have a supplier who  have unit prices of products to 4 decimal places but the line total is 2 decimal places. Obviously when you are dealing with pricing you can't have partial pennies (more that 2 decimal places) but you often find product unit prices to have 3 or 4 places.

We are new to FA (but find it an all round great product) and our old system worked in this way. This way you always have posted invoices on the system that match your suppliers.

Would be grateful if you could consider this for a future update.

Steve

Re: Decimal places of prices

I'm having the same problem as the original poster.  Does anyone have an answer or solution to this problem?  When I enter in fuel charges that have a rate that has 3 decimals and I have the system set at 2, it rounds the cost per unit and then multiplies that number by the total units so the grand total of that line item is off.

Instead, it should take the total number of units, multiply it by the unit price out to however many decimmals that price is and then round the total price to 2 decimals.  Is ther a way to do that?

Thanks

Re: Decimal places of prices

@joe: can @redoctober83's suggestion be taken into revising the formulae used in FA? Multiply rate with quantity first and then round off...

Re: Decimal places of prices

apmuthu wrote:

@joe: can @redoctober83's suggestion be taken into revising the formulae used in FA? Multiply rate with quantity first and then round off...

Bump.  Is this possible?  If it is, I would be so very very happy smile  Thanks.

Re: Decimal places of prices

@Joe and @Apmuthu, any kind of response or at least tell me how I can fix it myself.  Anything would be helpful.  Thank you

Re: Decimal places of prices

I have this problem too, and would appreciate some help. 

It's odd that we can purchase items with prices to several decimal places but can sell only to two decimals.  I have items that are bought and sold in large volumes for fractions of pennies.

11 (edited by apmuthu 12/15/2015 03:49:31 pm)

Re: Decimal places of prices

Have a look at includes/ui/ui_input.inc lines 768 to 775:

//JAM  Allow entered unit prices to be fractional
function unit_amount_cells($label, $name, $init=null, $params=null, $post_label=null, $dec=null)
{
    if (!isset($dec))
          $dec = user_price_dec()+2;

    amount_cells_ex($label, $name, 15, 15, $init, $params, $post_label, $dec+2);
}

Either 2 or 4 more decimal places are used when evaluating the unit amount.

If you extend the number of decimal places in the db table fields for unit price, the you can do all computations on unit_price with such more decimal places.

@joe: Is this issue addressed in FA 2.4?

Re: Decimal places of prices

Thanks for looking into this issue.  I tried the suggestion above but FA still rounds to 2dp. 

I changed the dec+2 to dec+4 in the ui_input.inc file, and changed the database x_prices table "price" column to DECIMAL(6,4). The database shows the 4dp but the values are still rounded to 2dp.

Please let me know where I'm going wrong.

Re: Decimal places of prices

I still don't understand what that function is supposed to be doing. Why would the increase in precision differ depending on whether a precision parameter has been passed to the function or taken from some configuration setting?

Not that it would matter, because as far as I could tell that function is never called.

Re: Decimal places of prices

You will have to logout and login again after clearing browser cache.

Re: Decimal places of prices

I just tried what you suggested and it is not working for me at all.  It either rounds the unit price to 2 decimal places if I have the display setup settings to 2 for price/amounts or if I set it to 3 and then click add item it keeps that the line total at 3 decimal places and the amount total at 3 decimal places when I need both of them to do the calculations and then round up to 2 decimal places.

What am I missing on getting this to work?  Thanks