Click here to Skip to main content
16,019,619 members
Home / Discussions / C#
   

C#

 
GeneralRe: Open-files-problem Pin
Nick Parker11-Aug-04 9:33
protectorNick Parker11-Aug-04 9:33 
GeneralRe: Open-files-problem Pin
Member 80940911-Aug-04 10:25
Member 80940911-Aug-04 10:25 
GeneralRe: Open-files-problem Pin
Dave Kreskowiak11-Aug-04 10:44
mveDave Kreskowiak11-Aug-04 10:44 
GeneralRe: Open-files-problem Pin
Member 80940911-Aug-04 10:52
Member 80940911-Aug-04 10:52 
GeneralPlease try to help me.. Pin
sreejith ss nair12-Aug-04 2:27
sreejith ss nair12-Aug-04 2:27 
GeneralRe: Please try to help me.. Pin
Dave Kreskowiak12-Aug-04 12:57
mveDave Kreskowiak12-Aug-04 12:57 
GeneralWeird Build Problem Pin
Guinness4Strength11-Aug-04 5:47
Guinness4Strength11-Aug-04 5:47 
GeneralString formatting problems Pin
moredip11-Aug-04 5:27
moredip11-Aug-04 5:27 
Hi all,

I'm writing some c# code to output some data in a format that a Fortran program can use. Yep, that's right, I did say Fortran Smile | :)

What I need is to write a floating point number into a string that is always 7 characters long, with a space prefixed before the number. For example:

 1.34567
 1234.67
 .234567

I figured that this would be a simple job with String.Format(), like so:

double dNumber;
String.Format(" {0,7:g}", dNumber );

however, the output of this is something like:
 91.3481478886182
 141.785454332755

it seems that the alignment part of the format string is being ignored.

Can anyone tell me what I'm missing here?

Cheers,

Pete
GeneralRe: String formatting problems Pin
sreejith ss nair11-Aug-04 7:33
sreejith ss nair11-Aug-04 7:33 
GeneralRe: String formatting problems Pin
moredip11-Aug-04 7:46
moredip11-Aug-04 7:46 
GeneralRe: String formatting problems Pin
sreejith ss nair11-Aug-04 8:01
sreejith ss nair11-Aug-04 8:01 
GeneralRe: String formatting problems Pin
moredip11-Aug-04 8:05
moredip11-Aug-04 8:05 
GeneralRe: String formatting problems Pin
moredip11-Aug-04 9:29
moredip11-Aug-04 9:29 
GeneralSafe version of unsafe code Pin
cheesepirate11-Aug-04 5:11
cheesepirate11-Aug-04 5:11 
GeneralRe: Safe version of unsafe code Pin
Mardawi11-Aug-04 10:04
Mardawi11-Aug-04 10:04 
GeneralRe: Safe version of unsafe code Pin
Anonymous11-Aug-04 10:56
Anonymous11-Aug-04 10:56 
QuestionRestricting Form-Moving to horizontal? Pin
jkersch11-Aug-04 4:17
jkersch11-Aug-04 4:17 
AnswerRe: Restricting Form-Moving to horizontal? Pin
Not Active11-Aug-04 4:58
mentorNot Active11-Aug-04 4:58 
GeneralRe: Restricting Form-Moving to horizontal? Pin
jkersch11-Aug-04 5:14
jkersch11-Aug-04 5:14 
GeneralXmlValidatingReader Pin
Not Active11-Aug-04 3:59
mentorNot Active11-Aug-04 3:59 
GeneralRe: XmlValidatingReader Pin
VenkatFor.NET11-Aug-04 7:28
VenkatFor.NET11-Aug-04 7:28 
GeneralRe: XmlValidatingReader Pin
Not Active12-Aug-04 3:57
mentorNot Active12-Aug-04 3:57 
QuestionDo you see the same results??? Pin
LongRange.Shooter11-Aug-04 3:13
LongRange.Shooter11-Aug-04 3:13 
AnswerRe: Do you see the same results??? Pin
Nick Parker11-Aug-04 4:16
protectorNick Parker11-Aug-04 4:16 
GeneralRe: Do you see the same results??? Pin
LongRange.Shooter11-Aug-04 5:43
LongRange.Shooter11-Aug-04 5:43 

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.