Quantities to 2 dec places?

 

enquirer99's picture

Hi. My quotes etc show quantities ordered to 2 decimal placs. How can I change this so it shows only integers - quantities in decimals are a bit superfluous.
Thx.

gmoskowitz's picture
Offline
Joined: 12/10/2008
Re: Quantities to 2 dec places?

If you always operate with integer quantities, you can change the precision with which the application displays and accepts quantities:
System -> Master Information -> Locales...
Then, for every locale you use:
select the locale
click Edit
change "Display Values to # Decimal Places: Qty.:" to 0
click Save

You cannot control the precision of the displayed quantity values for individual items. You can mark them as fractional or not in the Item definition, which affects whether or not you can sell or invoice fractions of an item, but the quantities will still be displayed using the Qty precision set on the locale.

Gil

enquirer99's picture
Offline
Joined: 02/04/2010
thx

Thank you

dschachtel's picture
Offline
Joined: 03/19/2009
Number Display

I've also struggled with this. One way I've gotten items to display consistently is to use the ROUND() in the SQL statement. EG ROUND(qty_ord,2) gives 1.00 whereas ROUND(qty_ord,0) gives 1.

Don't know if this is the "best" way, but I've had mixed results using the Locales method.

George

jrogelstad's picture
Offline
Joined: 12/10/2008
You can force it that way,

You can force it that way, but it is better to use the application's formatting functions so you get results consistent with locale settings. There are functions in the database like formatQty(numeric) and formatMoney(numeric) that will take a number and round it to the proper number of decimal places according to the user's locale settings cited above. If you are getting mixed results with locales it's probably due to a misunderstanding of when the various contexts are used (i.e. Qty, QtyPer, Money etc.). Usually you can figure that out by just understanding the use cases of these formats and studying the application. At worst, you need to look at source code on screens and reports and see what formats are being used there.

Also, keep in mind that locales can be set on a user by user basis, which could explain why one user sees one level of precision, and another sees something different.

dschachtel's picture
Offline
Joined: 03/19/2009
Locale Settings

Thanks for that tip. I did not know that locale settings could be on a user basis. Since many of the other items in the Systems menu are global, I had assumed that Locales were as well.

I've attached a screenshot of a work order as well as my locale settings window. You'll see that the Qty Per. in the WO screen shows 8 decimal places whereas the locale shows 6.

Also, there are times I need two decimal places in quantities to display and other times I want zero. I did check out the formatQty(numeric) etc functions, but can't figure out how to use them with multiple locales.

I am trying to create enthusiasm among users, and decimal displays that I am unable to manipulate does not help my cause.

So, I do agree that the SQL ROUND method is a force and inelegant, but as an inexperienced admin I am trying to balance the needs of the users/customers with elegant solutions.

I appreciate your response.

George

AttachmentSize
Decimal_Posting.pdf 64.59 KB