On Wednesday, 24 July 2019 at 15:45:08 UTC, Greatsam4sure wrote:
int main(){
 double mum = 0;
 Write("enter a number: ")
 readf(" %s\n",&num);
 Writeln(num);

}

How do I return the complete number the user enter since I don't since the user can enter numbers of various length with dmd approximating it.

I will appreciate any help

as drug said: writefln with formatting
in case no need prints just string representation use
  s/format https://dlang.org/phobos/std_format.html#format
auto str = num.format!"%.16s"; // using UFCS
or
auto str = "%.16s".format( num); // UFCS too for 2nd version of format
or
string str = format( "%.16s", num);

simple help can be asked on IRC channel too irc://irc.freenode.net/d
(HexChat, mIRC clients and others)

Reply via email to