🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.csharpbuilder.language.csharp
Article #79

How to convert Currency to Double?

#79
From: Peter Jones
Date: Tue, 28 Feb 2006 20:28
15 lines
1253 bytes
Hi,

Is there any way to directly convert a Currency (with '$' sign) into Double.

Below is my code:
//**************************
NumberFormatInfo nfi = new CultureInfo( "en-US", true ).NumberFormat;
// Displays a negative value with the default number of decimal digits (2).
double dOriginal = 1234.1154;
textBox1.Text = dOriginal.ToString("C", nfi);  //Output $1234.12
double dConverted = Convert.ToDouble(textBox1.Text) //error 

Thanks in advance,
Peter Jone
Technical Details
Message-ID: <4404c08d$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news4.google.com!newshub.sdsu.edu!logbridge.uoregon.edu!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: 1efe35,698ab06fa2172696,start
X-Google-Attributes: gid1efe35,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Peter Jones" <peter@hotmail.com>
Sender: "Peter Jones" <peter@hotmail.com>
Reply-To: "Peter Jones" <peter@hotmail.com>
Subject: How to convert Currency to Double?
Newsgroups: borland.public.csharpbuilder.language.csharp
X-User-Info: 67.71.91.93     
NNTP-Posting-Host: 207.105.83.66
Message-ID: <4404c08d$1@newsgroups.borland.com>
Date: 28 Feb 2006 13:28:45 -0700
X-Trace: newsgroups.borland.com 1141162125 207.105.83.66 (28 Feb 2006 13:28:45 -0700)
Lines: 16
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news4.google.com!newshub.sdsu.edu!logbridge.uoregon.edu!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail