# Decimal commas instead of points

**URL:** <https://discourse.julialang.org/t/decimal-commas-instead-of-points/67446>\
**Category:** General Usage\
**Tags:** numbers, io, locale\
**Created:** [August 31, 2021, 6:56pm UTC](https://discourse.julialang.org/t/decimal-commas-instead-of-points/67446 "2021-08-31T18:56:53Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![rafael.guerra](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rafael.guerra/32/216610_2.png) [@rafael.guerra](https://discourse.julialang.org/u/rafael.guerra)\
**Post date:** [January 7, 2024, 9:05pm UTC](https://discourse.julialang.org/t/decimal-commas-instead-of-points/67446/8 "2024-01-07T21:05:33Z")

</div>

Fyi, using [Mason’s ReplMaker.jl](https://discourse.julialang.org/t/ann-replmaker-jl/12306) we can get an interesting REPL with minimal effort, which accepts as input the decimal comma as decimal separator and the point as thousands separator. (Not exactly the OP requirement, but at least it can help to check the grocery cost-of-living.)

```julia
using ReplMaker

comma2point(str) = Meta.parse(replace(str, r"[-?0-9]{1,3}(.[0-9]{3})*(\,[0-9]+)?" => s -> replace(s, "."=>"", ","=>".")))

initrepl(comma2point,
    prompt_text="decimal-commas> ",
    prompt_color=:blue,
    start_key=',',
    mode_name="decimal-comma"
)

# Type comma `,` in the REPL to start (may need backspace first):
decimal-commas> 11.123,337 + 456,5 + 5.400 # 16979.837
decimal-commas> x = [11.123,337, 456,5, 5.400] # 3-element Vector{Float64}
decimal-commas> using Statistics
decimal-commas> (sum(x), mean(x), std(x)) # (16979.837, 5659.95, 5338.17)

```

---

_[View the full topic](https://discourse.julialang.org/t/decimal-commas-instead-of-points/67446)._
