Click here to Skip to main content
15,888,177 members
Home / Discussions / C#
   

C#

 
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.
GeneralRe: Creating Blank if zero decimal format string Pin
AndrusM31-Aug-08 10:35
AndrusM31-Aug-08 10:35 
GeneralRe: Creating Blank if zero decimal format string Pin
Wendelius31-Aug-08 10:58
mentorWendelius31-Aug-08 10:58 
QuestionCommandLineProcess Pin
netDeveloper30-Aug-08 5:34
netDeveloper30-Aug-08 5:34 
AnswerRe: CommandLineProcess Pin
Daniel Grunwald30-Aug-08 10:09
Daniel Grunwald30-Aug-08 10:09 
GeneralRe: CommandLineProcess Pin
netDeveloper31-Aug-08 0:26
netDeveloper31-Aug-08 0:26 
QuestionHow not to close the window Pin
Silvyster30-Aug-08 2:52
Silvyster30-Aug-08 2:52 
AnswerRe: How not to close the window Pin
Anthony Mushrow30-Aug-08 2:58
professionalAnthony Mushrow30-Aug-08 2:58 
AnswerRe: How not to close the window Pin
Abhijit Jana30-Aug-08 3:03
professionalAbhijit Jana30-Aug-08 3:03 
AnswerRe: How not to close the window Pin
DaveyM6930-Aug-08 8:43
professionalDaveyM6930-Aug-08 8:43 
QuestionListviewcontrol and background color Pin
Yustme30-Aug-08 1:09
Yustme30-Aug-08 1:09 
AnswerRe: Listviewcontrol and background color Pin
Wendelius30-Aug-08 3:02
mentorWendelius30-Aug-08 3:02 
GeneralRe: Listviewcontrol and background color Pin
Yustme30-Aug-08 7:47
Yustme30-Aug-08 7:47 
GeneralRe: Listviewcontrol and background color Pin
Wendelius30-Aug-08 8:03
mentorWendelius30-Aug-08 8:03 
GeneralRe: Listviewcontrol and background color Pin
Yustme30-Aug-08 8:40
Yustme30-Aug-08 8:40 
GeneralRe: Listviewcontrol and background color Pin
Wendelius30-Aug-08 8:57
mentorWendelius30-Aug-08 8:57 
GeneralRe: Listviewcontrol and background color Pin
Yustme30-Aug-08 10:50
Yustme30-Aug-08 10:50 
GeneralRe: Listviewcontrol and background color Pin
Wendelius30-Aug-08 11:05
mentorWendelius30-Aug-08 11:05 

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.