Re: Formatting floats and ints

2015-03-15 Thread via Digitalmars-d-learn
On Sunday, 15 March 2015 at 15:41:09 UTC, Darts wrote: Hey, I'm just looking for how to turn some numbers into strings in particualr ways. Specifically, I want to force some ints (and maybe floats too) to give me a string that consists of exactly four numbers ( 3005, 0038, 0130, etc ). I'd

Formatting floats and ints

2015-03-15 Thread Darts via Digitalmars-d-learn
Hey, I'm just looking for how to turn some numbers into strings in particualr ways. Specifically, I want to force some ints (and maybe floats too) to give me a string that consists of exactly four numbers ( 3005, 0038, 0130, etc ). I'd also like to know how to format a float to give me only

Re: Formatting floats and ints

2015-03-15 Thread Darts via Digitalmars-d-learn
Thanks! That works perfectly! ;) I'll remember they're called Format Strings now. Tangentially related follow up: if I want to cast a string to a dstring... what are the rules for that? I'm getting an object.Error@(0): array cast misalignment message when my program crashes tring to convert

Re: Formatting floats and ints

2015-03-15 Thread via Digitalmars-d-learn
On Sunday, 15 March 2015 at 18:52:29 UTC, Marc Schütz wrote: On Sunday, 15 March 2015 at 17:11:07 UTC, Darts wrote: Thanks! That works perfectly! ;) I'll remember they're called Format Strings now. Tangentially related follow up: if I want to cast a string to a dstring... what are the rules

Re: Formatting floats and ints

2015-03-15 Thread via Digitalmars-d-learn
On Sunday, 15 March 2015 at 17:11:07 UTC, Darts wrote: Thanks! That works perfectly! ;) I'll remember they're called Format Strings now. Tangentially related follow up: if I want to cast a string to a dstring... what are the rules for that? I'm getting an object.Error@(0): array cast