Re: Error in decimal divide in "?:" operator
- From: Barry Kelly <barry.j.kelly@xxxxxxxxx>
- Date: Wed, 07 Mar 2007 21:05:10 +0000
JayAchTee wrote:
I have a web service written in C# Visual Studio 2005 that calculates splits
between two or more timekeepers in a transaction. To set this up I have
several decimal data type variables from one particular timekeeper:
Using your code (roughly), I get:
~$ cat prog.cs
using System;
class App
{
static void Main()
{
decimal diff_time = 4.5M;
decimal rate = 130M;
decimal amount = diff_time * rate;
decimal totalAmount = 1605M;
decimal percent = (totalAmount == 0M ? 0M : amount /
totalAmount);
Console.WriteLine(percent);
}
}
~$ ./prog
0.364485981308411214953271028
Can you reproduce your behaviour in a simple, complete program like the
one above?
-- Barry
--
http://barrkel.blogspot.com/
.
- Prev by Date: Re: struct ToString() not automatically invoked
- Next by Date: Re: one line struct initialization
- Previous by thread: Re: Error in decimal divide in "?:" operator
- Next by thread: Re: Error in decimal divide in "?:" operator
- Index(es):