Re: Problems with money, decimal numbers after migration to Framework 1.1

From: Artek (A_at_A.com)
Date: 02/13/04


Date: Fri, 13 Feb 2004 12:40:19 +0100

Thank you Steven for your reply,
you understood well .Net 1.1 appends zeros at the end, but .Net 1.0 did't do
it.
Is there any system setting to restore .Net 1.0 behavior without changing
the code?

regards Artek

Użytkownik "Steven Cheng[MSFT]" <v-schang@online.microsoft.com> napisał w
wiadomości news:w98HyKg8DHA.3472@cpmsftngxa07.phx.gbl...
> Hi Artek,
>
>
> Thanks for posting in the community!
> From your description, you found that some certain numeric data type such
> as Money and Decimal(SQLSERVER) 's value will be appended with zero in the
> right of the decimal when retrieving them using ADO.NET component and
> display them on ASP.NET web form, yes?
> If there is anything I misunderstood, please feel free to let me know.
>
> Based on your situation, I've done some research and a few tests on my
> side, here is what I found:
> 1. As for the "Money" or "Decimal" or "Numeric" data type in the
sqlserver,
> the style how these type's value are displayed is controled by their
> "Precision" and "Scale" Column Property. The "scale" is used to specify
> number of digits to the right of the decimal point in a number.
>
> Here is the detailed description in MSDN:
> #Precision, Scale, and Length
>
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/tsqlref/ts_
> da-db_8rc5.asp
>
> You can found them in the Table' Design View in the Enterprise Manager.
For
> the "Decimal" and "Numeric" the "precision" and "Scale" property can be
> modified by user. But as fro the "Money" type, the two properties are
fixed
> to "19" and "4". That's why when you used the "Money" type, the output is
> like: "5.2000" , when you use "decimal(19,9)", the output is like
> "5.200000000".
>
> 2. In addtion, you may also have a try querying these datas from database
> using the SQL QueryAnalyzer, you may found that the result queried by
> QueryAnalyzer is also the same as which in ASP.NET page. So this behavior
> is controled by the database server rather than modified in ADO.NET
> components.
>
> Please check out the preceding suggestion. If you feel anything unclear or
> have any new findings, please feel free to post here.
>
>
>
> Regards,
>
> Steven Cheng
> Microsoft Online Support
>
> Get Secure! www.microsoft.com/security
> (This posting is provided "AS IS", with no warranties, and confers no
> rights.)
>
> Get Preview at ASP.NET whidbey
> http://msdn.microsoft.com/asp.net/whidbey/default.aspx
>