Project

General

Profile

Feature #12953

(Float, Integer, Rational)#round(half: :down)

Added by shyouhei (Shyouhei Urabe) about 1 year ago. Updated about 1 year ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
[ruby-core:78192]

Description

I learned that The Japanese Ministry of Health, Labor and Welfare requires that the insured burden amount of employment insurance be calculated in round half down mode. Details: http://www.mhlw.go.jp/topics/2005/04/tp0425-2.html

Given there is a real-world situation where half-down is actually mandatory, I think we should implement the (currently lacking) half: :down option.


Related issues

Related to Ruby trunk - Bug #12952: Incompatibility of a method signature between `Float#round` and `BigDecimal#round`Closed

Associated revisions

Revision 56897
Added by nobu (Nobuyoshi Nakada) about 1 year ago

round-down

  • numeric.c (round_half_down, int_round_half_down): support round-down mode.

Revision 56900
Added by nobu (Nobuyoshi Nakada) about 1 year ago

NEWS: mention [Feature #12953] [ci skip]

History

#1 [ruby-core:78193] Updated by nobu (Nobuyoshi Nakada) about 1 year ago

  • Subject changed from (Float, Rational)#round(half: :down) to (Float, Integer, Rational)#round(half: :down)

#2 Updated by mrkn (Kenta Murata) about 1 year ago

  • Related to Bug #12952: Incompatibility of a method signature between `Float#round` and `BigDecimal#round` added

#3 [ruby-core:78358] Updated by shyouhei (Shyouhei Urabe) about 1 year ago

We looked at this issue at todays developer meeting and no one (including matz who was there) was against it. I believe this is accepted.

#4 [ruby-core:78364] Updated by nobu (Nobuyoshi Nakada) about 1 year ago

  • Status changed from Open to Closed

Also available in: Atom PDF