Formatting floats and ints

Darts via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun Mar 15 08:41:08 PDT 2015


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 decimal place. If there are 
ways to print out in hex or scientific notation I'd also like to 
know about those too!

Sorry if this is a dumb question, I've been looking through the 
documentation but I don't know which words apply to this kind of 
thing so I'm just not sure if I'm meant to be looking for 
conversion, casting, parsing, formatting, trunicating, or 
something else .__.; Also is there a way to tell google that I 
never mean "golang" when I write "dlang" in a search? I'm this 
close to trying Bing just to see if it lets me look for D related 
stuff without giving me Go related stuff.


More information about the Digitalmars-d-learn mailing list