Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / June 2005

Tip: Looking for answers? Try searching our database.

Decimal in SQLServer

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Paperback Writer - 20 Jun 2005 14:36 GMT
Hi, i have in my application a field that is percentual, that means...can
have comma...my property that receive this data is a decimal and in my
SQLServer is also a decimal, but when i type, for example: 56.98, it's
ignoring the dot and saving 5698 in my SQLServer...how can i solve this ?
Wich type of data could i use ? float solve this ?

Signature

Please, check my theSpoke:
http://www.thespoke.net/MyBlog/dgroh/MyBlog.aspx

Patrice - 20 Jun 2005 14:47 GMT
How do you pass this value back to SQL Server for now ?

Patrice

> Hi, i have in my application a field that is percentual, that means...can
> have comma...my property that receive this data is a decimal and in my
> SQLServer is also a decimal, but when i type, for example: 56.98, it's
> ignoring the dot and saving 5698 in my SQLServer...how can i solve this ?
> Wich type of data could i use ? float solve this ?
Paperback Writer - 20 Jun 2005 15:31 GMT
for example: 134.562,56

Signature

Please, check my theSpoke:
http://www.thespoke.net/MyBlog/dgroh/MyBlog.aspx

> How do you pass this value back to SQL Server for now ?
>
[quoted text clipped - 5 lines]
>> ignoring the dot and saving 5698 in my SQLServer...how can i solve this ?
>> Wich type of data could i use ? float solve this ?
Patrice - 20 Jun 2005 15:56 GMT
I meant what is the code that pass back the value to SQL Server (building a
SQL statement as a string, using parameters ?)

From the later sample I'm not sure what are your settings. Is "." the
decimal separator as it seems from your first post or the thousands
separator as it looks like from the second post ?

For now it looks like to me this is a globalization issue when converting
the string back to a number (check that web.config, globalization section
uses the appropriate settings fro your country).

Patrice

> for example: 134.562,56
>
[quoted text clipped - 7 lines]
> >> ignoring the dot and saving 5698 in my SQLServer...how can i solve this ?
> >> Wich type of data could i use ? float solve this ?
bradley - 20 Jun 2005 16:14 GMT
Perhaps the local language setting on your SQL Server is not compatible with
this decimal formatting you are passing it. Execute the following on your
server, and it will return information about your localization setting:

sp_helplanguage @@LANGUAGE

> Hi, i have in my application a field that is percentual, that means...can
> have comma...my property that receive this data is a decimal and in my
> SQLServer is also a decimal, but when i type, for example: 56.98, it's
> ignoring the dot and saving 5698 in my SQLServer...how can i solve this ?
> Wich type of data could i use ? float solve this ?
Mark Rae - 20 Jun 2005 18:02 GMT
> Hi, i have in my application a field that is percentual, that means...can
> have comma...my property that receive this data is a decimal and in my
> SQLServer is also a decimal, but when i type, for example: 56.98, it's
> ignoring the dot and saving 5698 in my SQLServer...how can i solve this ?
> Wich type of data could i use ? float solve this ?

See the replies from Patrice & Bradley regarding globalisation.

E.g. "one thousand two hundred and thirty-four point five six" would be
expressed numerically in some countries (e.g. UK & US) as "1,234.56 ", but
in many other countries (e.g. France) it would be "1.234,56"

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2010 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.