Ruby 中的Sprintf ... sprintf简单地围绕数字.如何限制舍入? >> 3.998877.to_s[/^\d+\.\d{3}/].to_f => 3.998 >> 3.998877 ...
確定! 回上一頁