From: ExsonQu <hex...@gm...> - 2013-08-19 10:23:48
|
*Dear all:* In SupplierInvoice.php, the exchange rate is calculated as locale_numer_format($number,'variable'). Is it right? The currencies definition in currencies.php has use 8 as the decimal places and the number in database is over 11 digits. It seems not so good to use double type to store the number. Shall we use 8 instead of 'variable' in this file? Best regards! Exson -- View this message in context: http://weberp-accounting.1478800.n4.nabble.com/Is-the-exchange-rate-right-tp4656722.html Sent from the web-ERP-developers mailing list archive at Nabble.com. |
From: Phil D. <ph...@lo...> - 2013-08-19 10:30:22
|
think it should be capital Variable see include/MiscFunctions.php /*Functions to display numbers in locale of the user */ function locale_number_format($Number, $DecimalPlaces=0) { global $DecimalPoint; global $ThousandsSeparator; if ($_SESSION['Language']=='hi_IN.utf8' OR $_SESSION['Language']=='en_IN.utf8'){ return indian_number_format(floatval($Number),$DecimalPlaces); } else { if (!is_numeric($DecimalPlaces) AND $DecimalPlaces == 'Variable'){ $DecimalPlaces = mb_strlen($Number) - mb_strlen(intval($Number)); if ($DecimalPlaces > 0){ $DecimalPlaces--; } } return number_format(floatval($Number),$DecimalPlaces,$DecimalPoint,$ThousandsSeparator); } } On 19/08/13 22:23, ExsonQu wrote: > *Dear all:* > > In SupplierInvoice.php, the exchange rate is calculated as > locale_numer_format($number,'variable'). Is it right? > > The currencies definition in currencies.php has use 8 as the > decimal places and the number in database is over 11 digits. > > It seems not so good to use double type to store the number. > > Shall we use 8 instead of 'variable' in this file? > > Best regards! > > Exson > > > > -- > View this message in context: http://weberp-accounting.1478800.n4.nabble.com/Is-the-exchange-rate-right-tp4656722.html > Sent from the web-ERP-developers mailing list archive at Nabble.com. > > ------------------------------------------------------------------------------ > Get 100% visibility into Java/.NET code with AppDynamics Lite! > It's a free troubleshooting tool designed for production. > Get down to code-level detail for bottlenecks, with <2% overhead. > Download for free and get started troubleshooting in minutes. > http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk > _______________________________________________ > Web-erp-developers mailing list > Web...@li... > https://lists.sourceforge.net/lists/listinfo/web-erp-developers > -- Phil Phil Daintree Logic Works Ltd - +64 (0)275 567890 http://www.logicworks.co.nz |
From: ExsonQu <hex...@gm...> - 2013-08-19 12:52:29
|
*Hi,Phil:* Thank you for your reply. Yes, it's a Capital "Variable". The problem is that it retrieve a very long decimal number from the database and calculate it as it. Is it reasonable? Best regards! Exson -- View this message in context: http://weberp-accounting.1478800.n4.nabble.com/Is-the-exchange-rate-right-tp4656722p4656724.html Sent from the web-ERP-developers mailing list archive at Nabble.com. |
From: Ricard A. <pak...@gm...> - 2013-08-20 02:10:02
|
Hi Exson: I think a long decimal number is needed, the question is "how long?". One of my modifications to Currencies.php was made to allow the use of more decimals, up to 8. I would be happy to use even 1 or 2 more, and users in some countries as well http://en.wikipedia.org/wiki/Least-valued_currency_unit. But if your question was to change from type DOUBLE to type DECIMAL and limiting the number of decimals to 8 or 10, I think it is a wise change. We detected some errors due to rounding in exchange rate calculation. Try to sell to a customer in a different currency. Then chek the balance account for customer's debt and the customer's receivable report, if translated to functional rate, it's different. Small differences but differences after all :-) Just my 0,0000000002 cents. Regards, Ricard 2013/8/19 ExsonQu <hex...@gm...> > *Hi,Phil:* > > Thank you for your reply. > Yes, it's a Capital "Variable". The problem is that it retrieve a > very long decimal number from the database and calculate it as it. Is it > reasonable? > > Best regards! > > Exson > > > > > > -- > View this message in context: > http://weberp-accounting.1478800.n4.nabble.com/Is-the-exchange-rate-right-tp4656722p4656724.html > Sent from the web-ERP-developers mailing list archive at Nabble.com. > > > ------------------------------------------------------------------------------ > Get 100% visibility into Java/.NET code with AppDynamics Lite! > It's a free troubleshooting tool designed for production. > Get down to code-level detail for bottlenecks, with <2% overhead. > Download for free and get started troubleshooting in minutes. > http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk > _______________________________________________ > Web-erp-developers mailing list > Web...@li... > https://lists.sourceforge.net/lists/listinfo/web-erp-developers > |
From: ExsonQu <hex...@gm...> - 2013-08-20 08:00:51
|
*Hi, Richard:* I think you've caught the point. In my opinion, the first thing is that we should make the decimal numbers harmony in the whole system. And moreover, there are problem like what you said that there is difference of some calculation. I'm not sure if it's caused by double TYPE only. Or we should use rigid calculation method. It's worth digging it out. Thanks and best regards! Exson Ricard Andreu-2 wrote > Hi Exson: > > I think a long decimal number is needed, the question is "how long?". One > of my modifications to Currencies.php was made to allow the use of more > decimals, up to 8. I would be happy to use even 1 or 2 more, and users in > some countries as well > http://en.wikipedia.org/wiki/Least-valued_currency_unit. > > But if your question was to change from type DOUBLE to type DECIMAL and > limiting the number of decimals to 8 or 10, I think it is a wise change. > > We detected some errors due to rounding in exchange rate calculation. Try > to sell to a customer in a different currency. Then chek the balance > account for customer's debt and the customer's receivable report, if > translated to functional rate, it's different. Small differences but > differences after all :-) > > Just my 0,0000000002 cents. > > > > Regards, > Ricard > > > 2013/8/19 ExsonQu < > hexinfans@ > > > >> *Hi,Phil:* >> >> Thank you for your reply. >> Yes, it's a Capital "Variable". The problem is that it retrieve >> a >> very long decimal number from the database and calculate it as it. Is it >> reasonable? >> >> Best regards! >> >> Exson >> >> >> >> >> >> -- >> View this message in context: >> http://weberp-accounting.1478800.n4.nabble.com/Is-the-exchange-rate-right-tp4656722p4656724.html >> Sent from the web-ERP-developers mailing list archive at Nabble.com. >> >> >> ------------------------------------------------------------------------------ >> Get 100% visibility into Java/.NET code with AppDynamics Lite! >> It's a free troubleshooting tool designed for production. >> Get down to code-level detail for bottlenecks, with <2% overhead. >> Download for free and get started troubleshooting in minutes. >> http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk >> _______________________________________________ >> Web-erp-developers mailing list >> > Web-erp-developers@.sourceforge >> https://lists.sourceforge.net/lists/listinfo/web-erp-developers >> > > ------------------------------------------------------------------------------ > Introducing Performance Central, a new site from SourceForge and > AppDynamics. Performance Central is your source for news, insights, > analysis and resources for efficient Application Performance Management. > Visit us today! > http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktrk > _______________________________________________ > Web-erp-developers mailing list > Web-erp-developers@.sourceforge > https://lists.sourceforge.net/lists/listinfo/web-erp-developers -- View this message in context: http://weberp-accounting.1478800.n4.nabble.com/Is-the-exchange-rate-right-tp4656722p4656726.html Sent from the web-ERP-developers mailing list archive at Nabble.com. |