Home Ruby 使用bigdecimal处理大数据
Post
Cancel

Ruby 使用bigdecimal处理大数据

参考:https://www.codecademy.com/en/forum_questions/50fe886f68fc44056f00626c

require 'bigdecimal' 
require 'bigdecimal/util'

0.28.to_d * 100

nil.to_d   => 0.0

''.to_d => 0.0

"abc".to_d => 0.0

This post is licensed under CC BY 4.0 by the author.