# \[ANN\] pp-binary-ints 0.1.1

**URL:** <https://discuss.ocaml.org/t/ann-pp-binary-ints-0-1-1/9080>\
**Category:** Community\
**Tags:** pretty-printing, printf, format\
**Created:** [January 1, 2022, 12:55am UTC](https://discuss.ocaml.org/t/ann-pp-binary-ints-0-1-1/9080 "2022-01-01T00:55:45Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ifazk](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/ifazk/32/836_2.png) [@ifazk](https://discuss.ocaml.org/u/ifazk)\
**Post date:** [January 1, 2022, 12:55am UTC](https://discuss.ocaml.org/t/ann-pp-binary-ints-0-1-1/9080/1 "2022-01-01T00:55:45Z")

</div>

Tired of printing octals and hexadecimals and then mentally converting them to bits. Ever wanted to just see the bits in an int? Now you can!

Just run `opam install pp-binary-ints` and off you go:

```auto
# Pp_binary_ints.Int.to_string 0b10101001;;
- : string = "10101001"

```

You can find the documentation for the project and more examples of how to use it [here](https://ifazk.github.io/pp-binary-ints/pp-binary-ints/index.html).

The library is very customizable.

- You can choose to print with `0b` prefixes and `_` separators.
- You can choose to print zeros just like the non-zeros, with prefixes and separators.
- If you use zero padding, you can control how many leading zeros show up with the `~min_width` argument.
- It correctly handles the edge cases when adding `_` separators: you won’t get leading underscores.
- It includes pretty printers that work with `Format` and `Fmt` , not just `to_string` functions.
- Supports `int`, `int32`, `int64`, and `nativeint`.
- Don’t like the default prefixes and suffixes? Customize the prefixes and suffixes with the provided functor.
