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 one

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