[Awesome Ruby Gem] Use digital_capital gem to convert China Yuan from Arabic numerals into Chinese uppercase

digital_capital

Currency uppercase amount conversion/RMB uppercase conversion (Convert Arabic numerals into Chinese uppercase, RMB uppercase conversion)

Installation

You can install it as a gem:

1
$ gem install digital_capital

or add it into a Gemfile (Bundler):

1
2
3
4
5
# Gemfile

# GitHub - cheenwe/digital_capital: 货币大写金额转换/人民币大写转换(将阿拉伯数字转换成中文大写)
# https://github.com/cheenwe/digital_capital
gem 'digital_capital', `0.1.0'

Then, run bundle install.

1
$ bundle install

Usage

1
2
3
4
5
DigitalCapital.cb(199499499.922) # => "壹亿玖仟玖佰肆拾玖万玖仟肆佰玖拾玖元玖角贰分贰厘"

DigitalCapital.cb(1992) #=> "壹仟玖佰玖拾贰元整"

DigitalCapital.cb(-119.92) #=> "欠壹佰壹拾玖元玖角贰分"

References

[1 GitHub - cheenwe/digital_capital: 货币大写金额转换/人民币大写转换(将阿拉伯数字转换成中文大写) - https://github.com/cheenwe/digital_capital

[2] digital_capital | RubyGems.org | your community gem host - https://rubygems.org/gems/digital_capital