Skip to content

Instantly share code, notes, and snippets.

$KCODE = 'u'
# Goal: 小写金额转换为大写金额
# Limit: 金额整数位支持到亿位,小数点后支持两位并且不支持四舍五入
class ChineseFee
attr_reader :chn_numbers, :chn_units, :chn_decimals
def initialize
@chn_numbers = %w( )
@chn_units = %w( 拾万 佰万 仟万 亿)