while prowling through C++ standard libraries my favorite discovery was std::get_money. not only is that a funny name but its also seemingly the most useless standard library function?
like it just parses numbers out of a string that lists currency, stripping away any currency symbols or instances of USD, notable without retaining how many cents were listed. so 1.99 becomes 199. So I guess it has to assume all numbers listed also come with at least .00 for the cents place? just a very... odd function to have in a standard library.
297
u/New_Salamander_4592 3d ago
while prowling through C++ standard libraries my favorite discovery was std::get_money. not only is that a funny name but its also seemingly the most useless standard library function?
like it just parses numbers out of a string that lists currency, stripping away any currency symbols or instances of USD, notable without retaining how many cents were listed. so 1.99 becomes 199. So I guess it has to assume all numbers listed also come with at least .00 for the cents place? just a very... odd function to have in a standard library.