Sprintf in Ruby. roundingprintfruby. Solution 1: >> 3.998877.to_s[/^\d+\.\d{3}/].to_f => 3.998 >> 3.998877.to_s[/^\d+\.\d{4}/].to_f => 3.9988. Solution 2:.
確定! 回上一頁