mirror of
https://github.com/ETLCPP/etl.git
synced 2026-04-30 19:09:10 +08:00
#306-bugfix-to-string-formatting
This commit is contained in:
parent
174a3d79be
commit
569d7ea896
@ -287,6 +287,9 @@ namespace
|
||||
|
||||
str.assign(STR("Result "));
|
||||
CHECK(etl::string<20>(STR("Result -12.345678 ")) == etl::to_string(-12.345678, str, Format().precision(6).width(11).left(), true));
|
||||
|
||||
str.assign(STR("Result "));
|
||||
CHECK(etl::string<20>(STR("Result -0.123456 ")) == etl::to_string(-0.123456, str, Format().precision(6).width(10).left(), true));
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
|
||||
@ -260,6 +260,9 @@ namespace
|
||||
|
||||
CHECK(etl::u16string<20>(STR(" -12.345678")) == etl::to_string(-12.345678, str, Format().precision(6).width(11).right()));
|
||||
CHECK(etl::u16string<20>(STR("-12.345678 ")) == etl::to_string(-12.345678, str, Format().precision(6).width(11).left()));
|
||||
|
||||
CHECK(etl::u16string<20>(STR(" -0.123456")) == etl::to_string(-0.123456, str, Format().precision(6).width(10).right()));
|
||||
CHECK(etl::u16string<20>(STR("-0.123456 ")) == etl::to_string(-0.123456, str, Format().precision(6).width(10).left()));
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
@ -278,6 +281,9 @@ namespace
|
||||
|
||||
str.assign(STR("Result "));
|
||||
CHECK(etl::u16string<20>(STR("Result -12.345678 ")) == etl::to_string(-12.345678, str, Format().precision(6).width(11).left(), true));
|
||||
|
||||
str.assign(STR("Result "));
|
||||
CHECK(etl::u16string<20>(STR("Result -0.123456 ")) == etl::to_string(-0.123456, str, Format().precision(6).width(10).left(), true));
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
|
||||
@ -263,6 +263,9 @@ namespace
|
||||
|
||||
CHECK(etl::u32string<20>(STR(" -12.345678")) == etl::to_string(-12.345678, str, Format().precision(6).width(11).right()));
|
||||
CHECK(etl::u32string<20>(STR("-12.345678 ")) == etl::to_string(-12.345678, str, Format().precision(6).width(11).left()));
|
||||
|
||||
CHECK(etl::u32string<20>(STR(" -0.123456")) == etl::to_string(-0.123456, str, Format().precision(6).width(10).right()));
|
||||
CHECK(etl::u32string<20>(STR("-0.123456 ")) == etl::to_string(-0.123456, str, Format().precision(6).width(10).left()));
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
@ -281,6 +284,9 @@ namespace
|
||||
|
||||
str.assign(STR("Result "));
|
||||
CHECK(etl::u32string<20>(STR("Result -12.345678 ")) == etl::to_string(-12.345678, str, Format().precision(6).width(11).left(), true));
|
||||
|
||||
str.assign(STR("Result "));
|
||||
CHECK(etl::u32string<20>(STR("Result -0.123456 ")) == etl::to_string(-0.123456, str, Format().precision(6).width(10).left(), true));
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
|
||||
@ -264,6 +264,9 @@ namespace
|
||||
|
||||
CHECK(etl::wstring<20>(STR(" -12.345678")) == etl::to_string(-12.345678, str, Format().precision(6).width(11).right()));
|
||||
CHECK(etl::wstring<20>(STR("-12.345678 ")) == etl::to_string(-12.345678, str, Format().precision(6).width(11).left()));
|
||||
|
||||
CHECK(etl::wstring<20>(STR(" -0.123456")) == etl::to_string(-0.123456, str, Format().precision(6).width(10).right()));
|
||||
CHECK(etl::wstring<20>(STR("-0.123456 ")) == etl::to_string(-0.123456, str, Format().precision(6).width(10).left()));
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
@ -282,6 +285,9 @@ namespace
|
||||
|
||||
str.assign(STR("Result "));
|
||||
CHECK(etl::wstring<20>(STR("Result -12.345678 ")) == etl::to_string(-12.345678, str, Format().precision(6).width(11).left(), true));
|
||||
|
||||
str.assign(STR("Result "));
|
||||
CHECK(etl::wstring<20>(STR("Result -0.123456 ")) == etl::to_string(-0.123456, str, Format().precision(6).width(10).left(), true));
|
||||
}
|
||||
|
||||
//*************************************************************************
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user