Click here to Skip to main content
15,898,538 members
Home / Discussions / C#
   

C#

 
GeneralRe: which is better to choose? Pin
#realJSOP31-Aug-08 1:46
professional#realJSOP31-Aug-08 1:46 
AnswerRe: which is better to choose? Pin
Mohammad Dayyan31-Aug-08 4:37
Mohammad Dayyan31-Aug-08 4:37 
GeneralRe: which is better to choose? Pin
N a v a n e e t h31-Aug-08 18:09
N a v a n e e t h31-Aug-08 18:09 
AnswerRe: which is better to choose? Pin
nelsonpaixao31-Aug-08 13:13
nelsonpaixao31-Aug-08 13:13 
Questiongetting the public key of the recipient Pin
prasadbuddhika30-Aug-08 19:49
prasadbuddhika30-Aug-08 19:49 
Questionautoincrement alphabets Pin
abhijitjathar30-Aug-08 19:07
abhijitjathar30-Aug-08 19:07 
AnswerRe: autoincrement alphabets Pin
MarkB77730-Aug-08 19:43
MarkB77730-Aug-08 19:43 
AnswerRe: autoincrement alphabets Pin
#realJSOP31-Aug-08 1:46
professional#realJSOP31-Aug-08 1:46 
QuestionProperties Window File Dialog Pin
thrakazog30-Aug-08 13:30
thrakazog30-Aug-08 13:30 
AnswerRe: Properties Window File Dialog Pin
Mbah Dhaim30-Aug-08 14:32
Mbah Dhaim30-Aug-08 14:32 
AnswerRe: Properties Window File Dialog Pin
Thomas Stockwell30-Aug-08 14:33
professionalThomas Stockwell30-Aug-08 14:33 
AnswerRe: Properties Window File Dialog Pin
Dr. Emmett Brown30-Aug-08 14:45
Dr. Emmett Brown30-Aug-08 14:45 
QuestionHow can we disable BUMB sound ? Pin
Mohammad Dayyan30-Aug-08 10:20
Mohammad Dayyan30-Aug-08 10:20 
AnswerRe: How can we disable BUMB sound ? Pin
Christian Graus30-Aug-08 14:47
protectorChristian Graus30-Aug-08 14:47 
GeneralRe: How can we disable BUMB sound ? Pin
Mohammad Dayyan30-Aug-08 23:06
Mohammad Dayyan30-Aug-08 23:06 
GeneralRe: How can we disable BUMB sound ? Pin
Guffa31-Aug-08 4:03
Guffa31-Aug-08 4:03 
GeneralRe: How can we disable BUMB sound ? Pin
Mohammad Dayyan31-Aug-08 4:31
Mohammad Dayyan31-Aug-08 4:31 
GeneralRe: How can we disable BUMB sound ? Pin
Guffa31-Aug-08 10:32
Guffa31-Aug-08 10:32 
GeneralRe: How can we disable BUMB sound ? Pin
Mohammad Dayyan2-Sep-08 4:37
Mohammad Dayyan2-Sep-08 4:37 
QuestionCreating Blank if zero decimal format string Pin
AndrusM30-Aug-08 6:57
AndrusM30-Aug-08 6:57 
AnswerRe: Creating Blank if zero decimal format string Pin
Wendelius30-Aug-08 7:50
mentorWendelius30-Aug-08 7:50 
GeneralRe: Creating Blank if zero decimal format string Pin
AndrusM31-Aug-08 5:58
AndrusM31-Aug-08 5:58 
GeneralRe: Creating Blank if zero decimal format string Pin
Wendelius31-Aug-08 6:33
mentorWendelius31-Aug-08 6:33 
GeneralRe: Creating Blank if zero decimal format string Pin
AndrusM31-Aug-08 9:57
AndrusM31-Aug-08 9:57 
GeneralRe: Creating Blank if zero decimal format string Pin
Wendelius31-Aug-08 10:24
mentorWendelius31-Aug-08 10:24 
From the manual:
If format is null or an empty string, the return value of this instance is formatted with the general numeric format specifier ("G").

Simple test case:
System.Diagnostics.Debug.WriteLine("-------");
System.Diagnostics.Debug.WriteLine("Using F");
System.Diagnostics.Debug.WriteLine("-------");
System.Diagnostics.Debug.WriteLine("(0m).ToString(\"F\") => " + (0m).ToString("F"));
System.Diagnostics.Debug.WriteLine("(1.10m).ToString(\"F\") => " + (1.10m).ToString("F"));
System.Diagnostics.Debug.WriteLine("(1.1m).ToString(\"F\") => " + (1.1m).ToString("F"));
System.Diagnostics.Debug.WriteLine("(1.123m).ToString(\"F\") => " + (1.123m).ToString("F"));

System.Diagnostics.Debug.WriteLine("------------------");
System.Diagnostics.Debug.WriteLine("Using empty string");
System.Diagnostics.Debug.WriteLine("------------------");
System.Diagnostics.Debug.WriteLine("(0m).ToString() => " + (0m).ToString(""));
System.Diagnostics.Debug.WriteLine("(1.10m).ToString() => " + (1.10m).ToString(""));
System.Diagnostics.Debug.WriteLine("(1.1m).ToString() => " + (1.1m).ToString(""));
System.Diagnostics.Debug.WriteLine("(1.123m).ToString() => " + (1.123m).ToString(""));

System.Diagnostics.Debug.WriteLine("-------");
System.Diagnostics.Debug.WriteLine("Using G");
System.Diagnostics.Debug.WriteLine("-------");
System.Diagnostics.Debug.WriteLine("(0m).ToString(\"G\") => " + (0m).ToString("G"));
System.Diagnostics.Debug.WriteLine("(1.10m).ToString(\"G\") => " + (1.10m).ToString("G"));
System.Diagnostics.Debug.WriteLine("(1.1m).ToString(\"G\") => " + (1.1m).ToString("G"));
System.Diagnostics.Debug.WriteLine("(1.123m).ToString(\"G\") => " + (1.123m).ToString("G"));

results:
-------
Using F
-------
(0m).ToString("F") => 0,00
(1.10m).ToString("F") => 1,10
(1.1m).ToString("F") => 1,10
(1.123m).ToString("F") => 1,12
------------------
Using empty string
------------------
(0m).ToString() => 0
(1.10m).ToString() => 1,10
(1.1m).ToString() => 1,1
(1.123m).ToString() => 1,123
-------
Using G
-------
(0m).ToString("G") => 0
(1.10m).ToString("G") => 1,10
(1.1m).ToString("G") => 1,1
(1.123m).ToString("G") => 1,123


So are yuo actually looking for "G" like behaviour? AFAIK you must implement your own converter which has the knowledge of the actual input string.

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.