March 2, 2010 at 3:17 am
Hi...I have db with Cyrillic_General_CI_AS collation...and I have assemblie doing some calculations...problem is that I need "." instead of "," in numbers.
SqlContext.Pipe.Send((100 / 3).ToString("N2"))
SqlContext.Pipe.Send(FormatNumber(100 / 3,,,,))
are not showing correct values
please help...I have tried to change cultureinfo...but still no results..
March 2, 2010 at 4:43 am
Why are you formatting the numbers in the database? The numbers should be formatted in the presentation layer.
Adi
--------------------------------------------------------------
To know how to ask questions and increase the chances of getting asnwers:
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
March 2, 2010 at 4:52 am
that is correct, but....
I have some calculations in CLR...lets say a have to present on web page some data like miles per day...I have 30 days period and 100 miles per agent...
100/3=3.3333333
because of SQL server collation I get 3,333333
when I try to output data from CLR using FormatNumber(100/3,,) in VB.NET I get 3,3333.00 and that is not correct
March 2, 2010 at 5:28 am
If you use a numeric data numeric data type (by numeric, I mean any data type that can only store numbers such as int, decimal, money etc’) then the server doesn’t store the number with any coma or dot to separate every 3 numbers. Most chances are that you have a bug in the code.
Adi
--------------------------------------------------------------
To know how to ask questions and increase the chances of getting asnwers:
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
March 2, 2010 at 5:39 am
my CLR assemblie has output like this:
agentID, agent miles per day
for miles I have created table in vb.net where I'm doing all calculations with columns agentId(int) and MPD(decimal)
in CLR that table is using, I'm gust guessing, local regional settings, that has "," instead of "."...later on when I use
for each DR as datarow in Dtable
SetSqlString(dr(0),"miles " + formatnumer(dr(1) ,,,))
next
I get
miles 2,34.00
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply