convert base

Hugo via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Mon Jun 1 16:16:27 PDT 2015


On Monday, 1 June 2015 at 19:53:50 UTC, Steven Schveighoffer 
wrote:
> On 6/1/15 3:43 PM, Hugo wrote:
>> How could I convert a number form binary to an arbitrary base 
>> like 19 or
>> 23?
>
> import std.conv;
>
> to!(string)(100, 19); // "55"

Thanks! Is there a way to specify a source base different than 10?

And by the way, this method does not seem to work for bases 
higher than 36, how could one achieve for example a conversion to 
a base-60?


More information about the Digitalmars-d-learn mailing list