pretty::Px

A wrapper class for formatting fixed-precision prices returned from Databento APIs.

It supports configurable precision with std::setprecision; by default the precision is 9. Width and fill can be configured with std::setw and std::setfill.

API method
namespace pretty {
struct Px {
  std::int64_t val;
};
}
Example usage
1
2
3
4
5
6
#include <databento/pretty.hpp>
#include <iomanip>
#include <iostream>

std::cout << std::setprecision(2)
          << databento::pretty::Px{4'149'500'000'000} << '\n';
Example response
1
4149.50