473,656 Members | 2,983 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Convert Price.ToString( "C2") to decimal again?

Hi,

Suppose decimal Price contains 12,3. Price.ToString( "C2") gives 12,30 ?
(yes, I'm located in Europe).

What would be the best way to convert this string to a decimal again?

Steven

- - -
Jan 21 '06 #1
1 6096
See the Decimal.Parse method.
http://msdn.microsoft.com/library/de...parsetopic.asp

--
Tim Wilson
..NET Compact Framework MVP

"Steven Spits" <so*****@compan y.com> wrote in message
news:%2******** *********@TK2MS FTNGP12.phx.gbl ...
Hi,

Suppose decimal Price contains 12,3. Price.ToString( "C2") gives 12,30 ?
(yes, I'm located in Europe).

What would be the best way to convert this string to a decimal again?

Steven

- - -

Jan 21 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
4835
by: gregory_may | last post by:
I have an application I created called "JpegViewer.exe". It simply loads a Jpeg file and displays in on the screen. It works great, in my lab. When I am using it at a customer site, things change. Occasionally, it blows up with an Application Exception. It seems to only die at the customer site
24
2553
by: Alf P. Steinbach | last post by:
The eighth chapter (chapter 2.1) of my attempted Correct C++ tutorial is now available, although for now only in Word format -- comments welcome! Use the free & system-independent Open Office if you don't have Word. Classes <url: http://home.no.net/dubjai/win32cpptut/w32cpptut_02_01.zip> Introduces the C++ language feature used to define new types, namely classes. The focus in on creating safe and reusable classes. As a main
3
10046
by: Dam | last post by:
Using SqlServer : Query 1 : SELECT def.lID as IdDefinition, TDC_AUneValeur.VALEURDERETOUR as ValeurDeRetour FROM serveur.Data_tblDEFINITIONTABLEDECODES def, serveur.Data_tblTABLEDECODEAUNEVALEUR TDC_AUneValeur where def.TYPEDETABLEDECODES = 4
3
19466
by: Martin | last post by:
Hello everybody, I have the following question. As a join clause on Oracle we use " table1.field1 = table2.field1 (+) " On SQL Server we use " table1.field1 *= table2.field1 " Does DB2 have the same type of operator, without using the OUTER JOIN syntax ?
1
2716
by: Steven Spits | last post by:
Hi, Suppose decimal Price contains 12,3. Price.ToString("C2") gives 12,30 ? (yes, I'm located in Europe). What would be the best way to convert this string to a decimal again? Steven - - -
3
7559
by: David Lozzi | last post by:
Howdy, In my GridView i have some bound columns displaying currency. I have DataFormatString="${0:C2}" in one of the columns but the value being displayed is $35 . If the price has cents, then it will display the cents, like $35.3 or $35.55, but where there's no cents, it just displays $35. Shouldn't this override any datatypes from the datasource. Just to cofirm I am sending a valid datatype, I checked everything out and this gridview...
5
9094
by: Andrea | last post by:
Hi, I'm a newbie i want to know how can i convert string to its binary representation, i want to write a program where an example string "hello world" is transformed in his binary representation "11010010101...." and viceversa and then print on the stdout the result of the two representation. thanks in advance, Andrea
0
2050
by: Schadrach | last post by:
I'm having a strange problem, I have a small executable that runs a backup for a some data nightly, and as of September 22, 2007 it has ceased to function with the following error: Unhandled Exception: System.TypeInitializationException: The type initializer for "System.Threading.Thread" threw an exception. ---> System.ArgumentOutOfRangeException: Load factor needs to be between 0.1 and 1. Parameter name: loadFactor at...
0
1978
by: dan | last post by:
Hi, I've been using a GridView for some time but this is the first time I need to delete a row in the grid whose primary key consists of 2 fields (table columns). I have a table with primary key set to c1,c2 where c1 is a uniqueidentifier and c2 is int. The DataKeyNames in the gridview is defined as follows: DataKeyNames="c1,c2".
0
8296
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8816
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8497
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8598
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6162
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5627
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4150
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2721
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1928
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.