Convert string to decimal number in ruby

后端 未结 4 1010
一生所求
一生所求 2021-02-02 05:28

I need to work with decimals. In my program, the user need to put a number with decimals to convert that number.

The problem is: If I try to convert the argument into a

4条回答
  •  有刺的猬
    2021-02-02 06:01

    Capitalized conversion methods are a well-established Ruby idiom. See this great post from Advi Grimm

    Integer("641339524823408659")
    => 641339524823408659
    

提交回复
热议问题