Hi,

hmmm, just gave it a try - something like this
parm.Value = Math.Round (amount, 2);
really produces the correct result. I do not know the official defnition of
Money and Decimal - but as there is no rounding needed within .net i more
and more assume that this is a (new) issues in mono 2.6.4 (especially as 2.4
behaves exactly as .net) ... i'm going to file a bug ...

thanks

2010/6/13 Jacek Rużyczka <[email protected]>

> Hi,
>
> Am Sonntag 13 Juni 2010 10:59:35 schrieb Josef Semmler:
> > Hi,
> >
> > i'm either doing someing stupid - or there is a bug with handling
> > SqlDBType.Money in mono 2.6.4 ... please help me.
> >
> > I have a sqlserver 2005 -  in a table with an attribute "Amount" of type
> > "Money" i try to store different values, which are in the c# code
> > represented as "decimal" - for any reason, the values are stored
> completly
> > wrong.
> >
> I would suppose that MONEY is a fixed-point data type, which means that the
> decimal point is always two positions left of the last digit. This is why
> your
> code stores values like 144.568 incorrectly.
>
> I suppose that when you round (use the System.Math.Round() method) the
> decimal
> values to two digits, your code will work.
>
> Kind regards
> Jacek Rużyczka
>
> ----------------------------------------------------------------------
> Wakacyjna przygoda czeka! Zgarnij nagrody za 18 000zl!
> Sprawdz >>> http://linkint.pl/f2721
>
> _______________________________________________
> Mono-list maillist  -  [email protected]
> http://lists.ximian.com/mailman/listinfo/mono-list
>
_______________________________________________
Mono-list maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-list

Reply via email to