<?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet type="text/xsl" media="screen" href="/App_Themes/default/rss.xslt"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:media="http://search.yahoo.com/mrss/" xmlns:evnet="http://www.mscommunities.com/rssmodule/"><channel><title>Comment Feed for Number conversion and decimal accuracy (TechOff on Channel 9)</title><atom:link rel="self" type="application/rss+xml" href="http://channel9.msdn.com/forums/techoff/469915-number-conversion-and-decimal-accuracy/rss/default.aspx" /><image><url>http://mschnlnine.vo.llnwd.net/d1/Dev/App_Themes/C9/images/feedimage.png</url><title>Comment Feed for Number conversion and decimal accuracy (TechOff on Channel 9)</title><link>http://channel9.msdn.com/forums/TechOff/469915-Number-conversion-and-decimal-accuracy/</link></image><description>Number conversion and decimal accuracy</description><link>http://channel9.msdn.com/forums/TechOff/469915-Number-conversion-and-decimal-accuracy/</link><language>en-us</language><pubDate>Thu, 21 May 2009 15:11:31 GMT</pubDate><lastBuildDate>Thu, 21 May 2009 15:11:31 GMT</lastBuildDate><generator>EvNet (EvNet, Version=1.0.3608.3122, Culture=neutral, PublicKeyToken=null)</generator><item><title>Re: Re: Re: Re: Re: Re: Number conversion and decimal accuracy</title><description>&lt;p&gt;Damn accountants ........ but will keep your tip in mind, thx :)&lt;/p&gt;</description><comments></comments><link>http://channel9.msdn.com/forums/TechOff/469915-Number-conversion-and-decimal-accuracy/?CommentID=470044</link><pubDate>Thu, 21 May 2009 15:11:31 GMT</pubDate><guid isPermaLink="false">http://channel9.msdn.com/forums/TechOff/469915-Number-conversion-and-decimal-accuracy/?CommentID=470044</guid><evnet:views>0</evnet:views><evnet:viewtrackingurl>http://channel9.msdn.com/470044/WebViewBug.aspx?EVT=0</evnet:viewtrackingurl><evnet:previewtext>Damn accountants ........ but will keep your tip in mind, thx :)</evnet:previewtext><dc:creator>&amp;#193;rni Gunnar Ragnarsson</dc:creator><slash:comments>0</slash:comments><wfw:commentRss></wfw:commentRss><trackback:ping>http://channel9.msdn.com/470044/Trackback.aspx</trackback:ping></item><item><title>Re: Re: Re: Re: Re: Number conversion and decimal accuracy</title><description>&lt;p&gt;The only possible catch is that rounding in C# decimal type might not match the rounding used in the database if you have any rounding in your stored procedures.&amp;nbsp; By default C# decimal.Round() uses&amp;nbsp;rounding to even by default&amp;nbsp;while I beleive SQL Server uses 'away from zero' rounding.&amp;nbsp;We always use decimal.round(value, MidpointRounding.AwayFromZero) to ensure that they match.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Turns out Accountants seem to get quite annoyed when rounding errors put values out by a penny ...&lt;/p&gt;
&lt;p&gt;Herbie&lt;/p&gt;</description><comments></comments><link>http://channel9.msdn.com/forums/TechOff/469915-Number-conversion-and-decimal-accuracy/?CommentID=470038</link><pubDate>Thu, 21 May 2009 13:28:45 GMT</pubDate><guid isPermaLink="false">http://channel9.msdn.com/forums/TechOff/469915-Number-conversion-and-decimal-accuracy/?CommentID=470038</guid><evnet:views>0</evnet:views><evnet:viewtrackingurl>http://channel9.msdn.com/470038/WebViewBug.aspx?EVT=0</evnet:viewtrackingurl><evnet:previewtext>The only possible catch is that rounding in C# decimal type might not match the rounding used in the database if you have any rounding in your stored procedures.&amp;nbsp; By default C# decimal.Round() uses&amp;nbsp;rounding to even by default&amp;nbsp;while I beleive SQL Server uses 'away from zero'&amp;#8230;</evnet:previewtext><dc:creator>Herbie Smith</dc:creator><slash:comments>0</slash:comments><wfw:commentRss></wfw:commentRss><trackback:ping>http://channel9.msdn.com/470038/Trackback.aspx</trackback:ping></item><item><title>Re: Re: Re: Re: Number conversion and decimal accuracy</title><description>&lt;p&gt;And that totally did the trick .... I have never had to think about this in my applications up until now .... clearly need to read up on datatypes :)&lt;/p&gt;
&lt;p&gt;Thx guys ...&lt;/p&gt;</description><comments></comments><link>http://channel9.msdn.com/forums/TechOff/469915-Number-conversion-and-decimal-accuracy/?CommentID=470027</link><pubDate>Thu, 21 May 2009 11:44:51 GMT</pubDate><guid isPermaLink="false">http://channel9.msdn.com/forums/TechOff/469915-Number-conversion-and-decimal-accuracy/?CommentID=470027</guid><evnet:views>0</evnet:views><evnet:viewtrackingurl>http://channel9.msdn.com/470027/WebViewBug.aspx?EVT=0</evnet:viewtrackingurl><evnet:previewtext>And that totally did the trick .... I have never had to think about this in my applications up until now .... clearly need to read up on datatypes :)
Thx guys ...</evnet:previewtext><dc:creator>&amp;#193;rni Gunnar Ragnarsson</dc:creator><slash:comments>0</slash:comments><wfw:commentRss></wfw:commentRss><trackback:ping>http://channel9.msdn.com/470027/Trackback.aspx</trackback:ping></item><item><title>Re: Re: Re: Number conversion and decimal accuracy</title><description>&lt;p&gt;Stevo's right. That would change a lot. Decimal is exactly made for numbers where the accuracy is important.&lt;/p&gt;</description><comments></comments><link>http://channel9.msdn.com/forums/TechOff/469915-Number-conversion-and-decimal-accuracy/?CommentID=469938</link><pubDate>Wed, 20 May 2009 17:38:35 GMT</pubDate><guid isPermaLink="false">http://channel9.msdn.com/forums/TechOff/469915-Number-conversion-and-decimal-accuracy/?CommentID=469938</guid><evnet:views>0</evnet:views><evnet:viewtrackingurl>http://channel9.msdn.com/469938/WebViewBug.aspx?EVT=0</evnet:viewtrackingurl><evnet:previewtext>Stevo's right. That would change a lot. Decimal is exactly made for numbers where the accuracy is important.</evnet:previewtext><dc:creator>Tommy Carlier</dc:creator><slash:comments>0</slash:comments><wfw:commentRss></wfw:commentRss><trackback:ping>http://channel9.msdn.com/469938/Trackback.aspx</trackback:ping></item><item><title>Re: Re: Number conversion and decimal accuracy</title><description>&lt;p&gt;Would that change things ?&lt;/p&gt;</description><comments></comments><link>http://channel9.msdn.com/forums/TechOff/469915-Number-conversion-and-decimal-accuracy/?CommentID=469931</link><pubDate>Wed, 20 May 2009 17:22:55 GMT</pubDate><guid isPermaLink="false">http://channel9.msdn.com/forums/TechOff/469915-Number-conversion-and-decimal-accuracy/?CommentID=469931</guid><evnet:views>0</evnet:views><evnet:viewtrackingurl>http://channel9.msdn.com/469931/WebViewBug.aspx?EVT=0</evnet:viewtrackingurl><evnet:previewtext>Would that change things ?</evnet:previewtext><dc:creator>&amp;#193;rni Gunnar Ragnarsson</dc:creator><slash:comments>0</slash:comments><wfw:commentRss></wfw:commentRss><trackback:ping>http://channel9.msdn.com/469931/Trackback.aspx</trackback:ping></item><item><title>Re: Number conversion and decimal accuracy</title><description>&lt;p&gt;Firstly why aren't your using a decimal type in c#?&lt;/p&gt;</description><comments></comments><link>http://channel9.msdn.com/forums/TechOff/469915-Number-conversion-and-decimal-accuracy/?CommentID=469928</link><pubDate>Wed, 20 May 2009 17:06:17 GMT</pubDate><guid isPermaLink="false">http://channel9.msdn.com/forums/TechOff/469915-Number-conversion-and-decimal-accuracy/?CommentID=469928</guid><evnet:views>0</evnet:views><evnet:viewtrackingurl>http://channel9.msdn.com/469928/WebViewBug.aspx?EVT=0</evnet:viewtrackingurl><evnet:previewtext>Firstly why aren't your using a decimal type in c#?</evnet:previewtext><dc:creator>stevo_</dc:creator><slash:comments>0</slash:comments><wfw:commentRss></wfw:commentRss><trackback:ping>http://channel9.msdn.com/469928/Trackback.aspx</trackback:ping></item></channel></rss>