#include "amount_format.h" #include #include #include #include namespace dragonx { namespace util { std::string formatAmountFixed(double amount, int decimals) { std::ostringstream out; out.imbue(std::locale::classic()); out << std::fixed << std::setprecision(std::max(0, decimals)) << amount; return out.str(); } } // namespace util } // namespace dragonx