Click here to Skip to main content
16,004,854 members
Home / Discussions / C#
   

C#

 
GeneralRe: CustomLabel class deriving from Label and CustomBehaviuor classes Pin
keith maddox4-May-05 9:41
keith maddox4-May-05 9:41 
GeneralRe: CustomLabel class deriving from Label and CustomBehaviuor classes Pin
leppie4-May-05 3:27
leppie4-May-05 3:27 
GeneralRe: CustomLabel class deriving from Label and CustomBehaviuor classes Pin
Anonymous4-May-05 3:37
Anonymous4-May-05 3:37 
GeneralRe: CustomLabel class deriving from Label and CustomBehaviuor classes Pin
leppie4-May-05 3:52
leppie4-May-05 3:52 
GeneralRe: CustomLabel class deriving from Label and CustomBehaviuor classes Pin
Anonymous4-May-05 4:16
Anonymous4-May-05 4:16 
QuestionHow do word covert pdf Pin
shu_mi4-May-05 2:00
shu_mi4-May-05 2:00 
AnswerRe: How do word covert pdf Pin
DavidNohejl4-May-05 2:15
DavidNohejl4-May-05 2:15 
GeneralAdd thousand separator and keep decimal precision Pin
Jan R Hansen4-May-05 1:55
Jan R Hansen4-May-05 1:55 
Hi,

I have a numer in a string that may or may not have a decimal delimiter and some numbers afterwards, e.g. 1234 or 1234,5 or 1234,567. Now I want to show this number to the user with thousand separators, and keep the decimal precision from the original number. I.e. the number should be 1.234 and 1.234,5 and 1.234,567

If I use the following code

NumberFormatInfo nfi = new NumberFormatInfo();<br />
nfi.NumberDecimalSeparator = ",";<br />
nfi.NumberGroupSeparator = ".";<br />
double.Parse(m_value).ToString("N",nfi);


I'll get 1.234,00 and 1.234,50 and 1.234,57 - which is not what I want. Is there any other way to just add the thousand seperators and leave the decimal things unchanged ? It seems that nfi.NumberDecimalDigits misses a "dont mess with it" number...

Any ideas ?

/Jan


Do you know why it's important to make fast decisions? Because you give yourself more time to correct your mistakes, when you find out that you made the wrong one. Chris Meech on deciding whether to go to his daughters graduation or a Neil Young concert
GeneralRe: Add thousand separator and keep decimal precision Pin
keith maddox4-May-05 10:00
keith maddox4-May-05 10:00 
GeneralRe: Add thousand separator and keep decimal precision Pin
MBGeorge4-May-05 19:56
MBGeorge4-May-05 19:56 
GeneralSyncronization Pin
vchedalla4-May-05 1:26
vchedalla4-May-05 1:26 
GeneralRe: Syncronization Pin
MoustafaS4-May-05 3:10
MoustafaS4-May-05 3:10 
GeneralRe: Syncronization Pin
S. Senthil Kumar4-May-05 4:30
S. Senthil Kumar4-May-05 4:30 
QuestionHow to set diffrent words in a label with diffrent fonts Pin
Roggey4-May-05 0:12
Roggey4-May-05 0:12 
AnswerRe: How to set diffrent words in a label with diffrent fonts Pin
Dave Kreskowiak4-May-05 4:14
mveDave Kreskowiak4-May-05 4:14 
AnswerRe: How to set diffrent words in a label with diffrent fonts Pin
keith maddox4-May-05 10:05
keith maddox4-May-05 10:05 
GeneralAdd-in Solutions from Visual Studio .NET 2003 to 2005 Pin
rathishps3-May-05 23:28
rathishps3-May-05 23:28 
GeneralRe: Add-in Solutions from Visual Studio .NET 2003 to 2005 Pin
Judah Gabriel Himango4-May-05 4:35
sponsorJudah Gabriel Himango4-May-05 4:35 
GeneralRe: Add-in Solutions from Visual Studio .NET 2003 to 2005 Pin
rathishps6-May-05 2:17
rathishps6-May-05 2:17 
Generalchecking directory or file permission of network folders Pin
Xiao_M3-May-05 22:48
Xiao_M3-May-05 22:48 
GeneralCryptography Pin
Yaakov Davis3-May-05 22:36
Yaakov Davis3-May-05 22:36 
GeneralRe: Cryptography Pin
Trance Junkie4-May-05 4:13
Trance Junkie4-May-05 4:13 
GeneralRe: Cryptography Pin
Yaakov Davis4-May-05 4:46
Yaakov Davis4-May-05 4:46 
GeneralRe: Cryptography Pin
Enishi4-May-05 4:57
Enishi4-May-05 4:57 
GeneralRe: Cryptography Pin
Yaakov Davis4-May-05 7:44
Yaakov Davis4-May-05 7:44 

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.