www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 20568] New: Unable to convert string to int or uint ... if

https://issues.dlang.org/show_bug.cgi?id=20568

          Issue ID: 20568
           Summary: Unable to convert string to int or uint ... if string
                    having underscore character but work with float ....
           Product: D
           Version: D2
          Hardware: All
               URL: http://dlang.org/
                OS: All
            Status: NEW
          Severity: trivial
          Priority: P3
         Component: phobos
          Assignee: nobody puremagic.com
          Reporter: apz28 hotmail.com

//Inconsistent behavior

import std.conv : to;

auto workWithFloat = to!float("1_000");

auto failWithInt = to!int("1_000");
auto failWithInt = to!uint("1_000");

--
Feb 08 2020