[#100689] [Ruby master Feature#17303] Make webrick to bundled gems or remove from stdlib — hsbt@...
Issue #17303 has been reported by hsbt (Hiroshi SHIBATA).
11 messages
2020/11/02
[#100852] [Ruby master Feature#17326] Add Kernel#must! to the standard library — zimmerman.jake@...
Issue #17326 has been reported by jez (Jake Zimmerman).
24 messages
2020/11/14
[#100930] [Ruby master Feature#17333] Enumerable#many? — masafumi.o1988@...
Issue #17333 has been reported by okuramasafumi (Masafumi OKURA).
10 messages
2020/11/18
[#101071] [Ruby master Feature#17342] Hash#fetch_set — hunter_spawn@...
Issue #17342 has been reported by MaxLap (Maxime Lapointe).
26 messages
2020/11/25
[ruby-core:101035] [Ruby master Feature#17339] Semantic grouping with BigDecimal#to_s
From:
co.chuma@...
Date:
2020-11-24 04:24:47 UTC
List:
ruby-core #101035
Issue #17339 has been updated by chumaltd (Takahiro Chuma).
I read doc again, and understand the situation.
If we have a chance to change API, another formatting option like `#to_s('G')` can be good that works as '3F'.
Then we'll have beautiful 'E', 'F', 'G' options.
As I referred, SI confirmed 3 digit grouping policy twice(1948 and 2003). Other than 3 is not preferred way.
I think financial or business common practices follow 3 digit rule, too.
So, grouping option should have its default, and formatting with digit like '5F' will be more private.
----------------------------------------
Feature #17339: Semantic grouping with BigDecimal#to_s
https://bugs.ruby-lang.org/issues/17339#change-88706
* Author: chumaltd (Takahiro Chuma)
* Status: Open
* Priority: Normal
----------------------------------------
# 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/
Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>