Module: FFakerTW::Number
Instance Method Summary collapse
Methods included from ModuleUtils
const_missing, k, luhn_check, underscore, unique
Methods included from RandomUtils
#fetch_sample, #rand, #shuffle
Instance Method Details
#decimal(whole_digits: 1, fractional_digits: 1) ⇒ Object
12 13 14 15 16 |
# File 'lib/ffakerTW/number.rb', line 12 def decimal(whole_digits: 1, fractional_digits: 1) whole_part_pattern = generate_pattern(whole_digits) fractional_part_pattern = generate_pattern(fractional_digits).reverse FFakerTW.numerify("#{whole_part_pattern}.#{fractional_part_pattern}").to_f end |