Convert a decimal number to a fraction / rational number

前端 未结 11 1836
情歌与酒
情歌与酒 2020-12-01 16:36

In JavaScript, is there any way to convert a decimal number (such as 0.0002) to a fraction represented as a string (such as \"2/10000\")?

I

11条回答
  •  时光说笑
    2020-12-01 17:00

    Have tried something like this?

    
    
                                     
                  
提交回复
热议问题