This is a multi-part message in MIME format.
--------------030001000503030304070905
Content-Type: text/plain; charset=ISO-8859-2; format=flowed
Content-Transfer-Encoding: 7bit
Tomasz Ostrowski wrote:
> On 2008-05-12 20:49, Justin wrote:
>
>
>> We take (List Price * discount Percent) * Number of Pieces = net
>> price.
>>
>
> This is wrong. You should do in Excel:
> ( price * amount ) * discount
> As otherwise any small error in representation of price*discount would
> be multiplied by usually high amount.
>
Your saying in Excel, Multiplication is not Commutativity??? that
sends shudders down my back
> I'd do this way to get it right:
> round( round(price * amount, 2) * discount, 2)
> This way every sum should match. There could be errors, but in pennies,
> not dollars. These errors will be because Excel does not have a decimal
> type.
>
That makes sense you are keeping the precision the same through the
calculation
> It is a lost case to break Postgres so it will match Excel. Much easier
> would be to correct Excel spreadsheet. And this is a right thing to do.
>
> Regards
> Tometzky
>
--------------030001000503030304070905
Content-Type: text/html; charset=ISO-8859-2
Content-Transfer-Encoding: 8bit
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-2" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Tomasz Ostrowski wrote:
<blockquote cite="mid:482937E9.9030509@[EMAIL PROTECTED]
" type="cite">
<pre wrap="">On 2008-05-12 20:49, Justin wrote:
</pre>
<blockquote type="cite">
<pre wrap="">We take (List Price * discount Percent) * Number of
Pieces = net
price.
</pre>
</blockquote>
<pre wrap=""><!---->
This is wrong. You should do in Excel:
( price * amount ) * discount
As otherwise any small error in representation of price*discount would
be multiplied by usually high amount.
</pre>
</blockquote>
<br>
Your saying in Excel, Multiplication is not Commutativity??? that
sends shudders down my back<br>
<blockquote cite="mid:482937E9.9030509@[EMAIL PROTECTED]
" type="cite">
<pre wrap="">I'd do this way to get it right:
round( round(price * amount, 2) * discount, 2)
This way every sum should match. There could be errors, but in pennies,
not dollars. These errors will be because Excel does not have a decimal
type.
</pre>
</blockquote>
That makes sense you are keeping the precision the same through the
calculation<br>
<blockquote cite="mid:482937E9.9030509@[EMAIL PROTECTED]
" type="cite">
<pre wrap="">It is a lost case to break Postgres so it will match Excel.
Much easier
would be to correct Excel spreadsheet. And this is a right thing to do.
Regards
Tometzky
</pre>
</blockquote>
</body>
</html>
--------------030001000503030304070905--


|