webERP Forum

Full Version: Shrink Factor - No Decimals - SOLVED
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Stocks.php

Shrink Factor is rounding to zero decimal places. We use 20-foot lengths of pipe that have loss due to curf so shrinkage is small but must be accounted for. The script writes the value to the database but shows a zero due to rounding during display.

I changed the locale_number_format to use 'Variable' instead of '0'. Or maybe we should use $_POST['DecimalPlaces'] value at the part?

Perhaps some of you have a better idea?
Well there is another function - filter_number_format in MiscFunctions.php that formats the number for SQL ... it sounds as though we have missed the conversion back to SQL format numbers.
This is why I always ask the experts!
Well I had a look and this rounding is happening in input as although you may have set to the shrink factor to 0.2 it rounds to 0 decimal places as you correctly point out - so next time you hit the enter button it is updated to zip - your solution sounds good or maybe just 2 dp might do the trick.
The reason I have so many decimal places is because a length of pipe is twenty feet and each time the pipe is cut on the DoALL saw we have about 1/4" curf. We also lose some during the square-and-bevel process so the number may be a little larger.

Typically 13 cuts per length so 13 x 0.25 in = 3.25 in

3.25 in of 20 ft = 3.25 / 240 = 0.013541 loss

This is why we have such a small value.