# \[ANN\] InstaRound.jl

**URL:** <https://discourse.julialang.org/t/ann-instaround-jl/67807>\
**Category:** Package Announcements\
**Created:** [September 7, 2021, 11:38am UTC](https://discourse.julialang.org/t/ann-instaround-jl/67807 "2021-09-07T11:38:32Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![PyDataBlog](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pydatablog/32/12327_2.png) [@PyDataBlog](https://discourse.julialang.org/u/PyDataBlog)\
**Post date:** [September 7, 2021, 11:38am UTC](https://discourse.julialang.org/t/ann-instaround-jl/67807/1 "2021-09-07T11:38:32Z")

</div>

I am excited to share one of the Julia packages I worked on during the summer.

[InstaRound.jl](https://github.com/PyDataBlog/InstaRound.jl) is a small utility Julia package which extends Base.round with a more human readable rounding style. This is useful for anyone who prefers numerical outputs in a more interpretable format.

```julia
using InstaRound

julia> round(IGRound, 1_000_000; names=false)
"1.0M"

julia> round(IGRound, 1_000_000; names=true)
"1.0 Million"

```

**Main Feature**

- Covers all representations up to **10^69** (‘_Unvigintillion_’ - I never heard of it until this project).

Any form of a feedback will be greatly appreciated.

Special mention to @Skoffer for his brilliant (as always) conversion of the problem into a neat mathematical representation.

---

<div class="post-metadata">

**Author:** ![Juan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/juan/32/7657_2.png) [@Juan](https://discourse.julialang.org/u/Juan)\
**Post date:** [September 7, 2021, 3:23pm UTC](https://discourse.julialang.org/t/ann-instaround-jl/67807/2 "2021-09-07T15:23:17Z")

</div>

Why not use common scientific notation?

> **[Template:SI prefixes (infobox)](https://en.wikipedia.org/wiki/Template:SI_prefixes_(infobox))**

---

<div class="post-metadata">

**Author:** ![PyDataBlog](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pydatablog/32/12327_2.png) [@PyDataBlog](https://discourse.julialang.org/u/PyDataBlog)\
**Post date:** [September 7, 2021, 8:48pm UTC](https://discourse.julialang.org/t/ann-instaround-jl/67807/3 "2021-09-07T20:48:18Z")

</div>

> [@Juan](#):
>
> Why not use common scientific notation?
> 
> [Template:SI prefixes (infobox) - Wikipedia](https://en.wikipedia.org/wiki/Template:SI_prefixes_(infobox))

That could also be an option for users. The focus here was to move to more ‘grammar’ like conventions.

---

<div class="post-metadata">

**Author:** ![jlapeyre](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jlapeyre/32/4514_2.png) [@jlapeyre](https://discourse.julialang.org/u/jlapeyre)\
**Post date:** [September 7, 2021, 9:29pm UTC](https://discourse.julialang.org/t/ann-instaround-jl/67807/4 "2021-09-07T21:29:57Z")

</div>

This package is doing two separate things. 1) rounding a number. and 2) converting a number to a particular string representation. You might want to consider separating these features, although that would be somewhat more ambitious.

---

<div class="post-metadata">

**Author:** ![Juan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/juan/32/7657_2.png) [@Juan](https://discourse.julialang.org/u/Juan)\
**Post date:** [September 8, 2021, 12:04am UTC](https://discourse.julialang.org/t/ann-instaround-jl/67807/5 "2021-09-08T00:04:32Z")

</div>

And what convention is it using, the long or short scale?

> **[Long and short scales](https://en.wikipedia.org/wiki/Long_and_short_scale)**
>
> The long and short scales are two of several naming systems for integer powers of ten which use some of the same terms for different magnitudes.
> Some languages, particularly in East Asia and South Asia, have large number naming systems that are different from both the long and short scales, such as Chinese, Japanese, or Korean numerals and the Indian numbering system. 
> Much of the remainder of the world adopted either the short scale or the long scale for everyday counting powers of ten. Co...

---

<div class="post-metadata">

**Author:** ![jw3126](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jw3126/32/3086_2.png) [@jw3126](https://discourse.julialang.org/u/jw3126)\
**Post date:** [September 8, 2021, 6:36am UTC](https://discourse.julialang.org/t/ann-instaround-jl/67807/6 "2021-09-08T06:36:06Z")

</div>

Seems short scale is used otherwise Univigintillion would be much bigger 😃

> **[Integers.info - One Unvigintillion - 1 followed by 66 zeros](https://integers.info/large-numbers/unvigintillion)**
>
> Information about the large number One Unvigintillion, which is a 1 followed by 66 zeros

---

<div class="post-metadata">

**Author:** ![PyDataBlog](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pydatablog/32/12327_2.png) [@PyDataBlog](https://discourse.julialang.org/u/PyDataBlog)\
**Post date:** [September 8, 2021, 6:41am UTC](https://discourse.julialang.org/t/ann-instaround-jl/67807/7 "2021-09-08T06:41:58Z")

</div>

> [@Juan](#):
>
> And what convention is it using, the long or short scale?

According to that, the short scale was adopted for this project.

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [September 8, 2021, 7:45am UTC](https://discourse.julialang.org/t/ann-instaround-jl/67807/8 "2021-09-08T07:45:42Z")

</div>

> [@PyDataBlog](#):
>
> Any form of a feedback will be greatly appreciated.

I second @jlapeyre’s suggestion: rounding to human-readable quantities and converting to `String` should be separate functionalities.

Eg you could make `round` return a wrapper defined by your package that subtypes `<: Real`, and have `string` convert it to a string.
