# Custom formatter for a DataFrame column?

**URL:** <https://discourse.julialang.org/t/custom-formatter-for-a-dataframe-column/7777>\
**Category:** Data\
**Created:** [December 15, 2017, 2:25am UTC](https://discourse.julialang.org/t/custom-formatter-for-a-dataframe-column/7777 "2017-12-15T02:25:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![airpmb](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/airpmb/32/7826_2.png) [@airpmb](https://discourse.julialang.org/u/airpmb)\
**Post date:** [December 15, 2017, 2:25am UTC](https://discourse.julialang.org/t/custom-formatter-for-a-dataframe-column/7777/1 "2017-12-15T02:25:41Z")

</div>

Is there a good way to customize the formatting of the values in particular columns of a `DataFrame`? I have a column that is using the types from [Currencies.jl](https://github.com/JuliaFinance/Currencies.jl), which have great functionality but their default display format isn’t what I’d like to see in the table:

```nohighlight
julia> using Currencies
julia> @usingcurrencies USD, CAD
julia> df = DataFrame(name=["401k", "RRSP"], balance=[1500000USD, 200000CAD])
2×2 DataFrames.DataFrame
│ Row │ name │ balance │
├─────┼────────┼─────────────┤
│ 1 │ "401k" │ 1.5e6USD │
│ 2 │ "RRSP" │ 200000.0CAD │

julia> format(1500000CAD, styles=[:us])
"CAD 1,500,000.00"

```

Note that I’m using DataFrames 0.10.1, but I also looked at the 0.11 documentation and didn’t see anything that looks applicable to this.

---

<div class="post-metadata">

**Author:** ![nalimilan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nalimilan/32/147_2.png) [@nalimilan](https://discourse.julialang.org/u/nalimilan)\
**Post date:** [December 15, 2017, 8:57am UTC](https://discourse.julialang.org/t/custom-formatter-for-a-dataframe-column/7777/2 "2017-12-15T08:57:31Z")

</div>

Data frames use the standard `show` methods to represent values, so the only solution is to override that. It would make sense to improve this by at least using the same numeric format for all entries, like when printing vectors.
