[#114181] [Ruby master Bug#19767] [Not really a bug, but more a not ideal notification] "historical binary regexp match" when using the "n" modifier in a ruby regex — "rubyFeedback (robert heiler) via ruby-core" <ruby-core@...>
SXNzdWUgIzE5NzY3IGhhcyBiZWVuIHJlcG9ydGVkIGJ5IHJ1YnlGZWVkYmFjayAocm9iZXJ0IGhl
3 messages
2023/07/14
[ruby-core:114065] [Ruby master Feature#17339] Semantic grouping with BigDecimal#to_s
From:
"cryptogopher (crypto gopher) via ruby-core" <ruby-core@...>
Date:
2023-07-01 15:02:17 UTC
List:
ruby-core #114065
Issue #17339 has been updated by cryptogopher (crypto gopher).
I've sent pull request with solution as specified by author of issue: https://github.com/ruby/bigdecimal/pull/264
----------------------------------------
Feature #17339: Semantic grouping with BigDecimal#to_s
https://bugs.ruby-lang.org/issues/17339#change-103736
* Author: chumaltd (Takahiro Chuma)
* Status: Assigned
* Priority: Normal
* Assignee: mrkn (Kenta Murata)
----------------------------------------
# Abstract
Thousands, millions, ... should be expressible with `BigDecimal#to_s`.
# Background
`BigDecimal('1234567').to_s('3F')` returns "123 456 7.0".
# Proposal
- Have an option with which `BigDecimal('1234567').to_s('3F')` returns "_1 234 567_.0".
- With decimal, `BigDecimal('1234567.8901234').to_s('3F')` should return "1 234 567.890 123 4".
- Default behavior should be the above in long term.
- And/Or, it would be nice to have a pretty method name. I think #to_s('3F') has universal use cases like money calculation.
# Discussion
- International System of Units aka SI defines 3-digit-grouping on long numeric sequence.
https://www1.bipm.org/jsp/en/ViewCGPMResolution.jsp?CGPM=22&RES=10
- Original discussion in 1948 shows some example of 3-digit-grouping.
https://www1.bipm.org/utils/common/pdf/CGPM/CGPM9.pdf#page=117
# Summary
We want to have a natural format.
--
https://bugs.ruby-lang.org/
______________________________________________
ruby-core mailing list -- ruby-core@ml.ruby-lang.org
To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
ruby-core info -- https://ml.ruby-lang.org/mailman3/postorius/lists/ruby-core.ml.ruby-lang.org/