Available languages: [Python](https://databento.com/docs/api-historical/helpers/pretty-px.python.md) · [C++](https://databento.com/docs/api-historical/helpers/pretty-px.cpp.md) · [Rust](https://databento.com/docs/api-historical/helpers/pretty-px.rust.md) · [HTTP](https://databento.com/docs/api-historical/helpers/pretty-px.http.md)

Source: https://databento.com/docs/api-historical/helpers/pretty-px


### 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

```cpp
namespace pretty {
struct Px {
  std::int64_t val;
};
}
```

#### Example usage

```cpp
#include <databento/pretty.hpp>
#include <iomanip>
#include <iostream>

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

```plaintext
4149.50
```
