Class: HumanNumber::NumberSystem::EastAsianSystem
- Inherits:
-
DefaultSystem
- Object
- DefaultSystem
- HumanNumber::NumberSystem::EastAsianSystem
- Defined in:
- lib/human_number/number_system.rb
Overview
East Asian number formatting system using traditional Asian unit progression.
This system implements the traditional East Asian number formatting convention using powers of 10,000 (万) progression for mid-range numbers, then jumping to 100,000,000 (억/億) and 1,000,000,000,000 (조/兆). This aligns with how numbers are conceptualized and spoken in Korean, Japanese, and Chinese.
The system uses culturally appropriate separators and maintains the original case for Asian characters, unlike the Western system which lowercases full words.
Constant Summary collapse
- UNIT_DEFINITIONS =
[ { key: :trillion, divisor: 1_000_000_000_000 }, { key: :hundred_million, divisor: 100_000_000 }, { key: :ten_thousand, divisor: 10_000 }, ].freeze
Class Method Summary collapse
Methods inherited from DefaultSystem
format_below_min_unit, format_in_abbreviated_mode, format_in_complete_mode
Class Method Details
.format_number(number, locale:, abbr_units: true, min_unit: nil, max_digits: 2, trim_zeros: true) ⇒ Object
565 566 567 568 |
# File 'lib/human_number/number_system.rb', line 565 def format_number(number, locale:, abbr_units: true, min_unit: nil, max_digits: 2, trim_zeros: true) @current_locale = locale.to_sym super end |