JavaScript的math对象里面哪里有found()这个函数啊?

解决方案 »

  1.   

    对不起,是math.round().Because we have Brazil custom who use comma as decimal separator, so math.round(1,5) should return 2. But currently it returns NaN.
      

  2.   

    是round吧?
    <script>
    function round(n){
    m=Number(n.replace(',','.'))
    return Math.round(m)
    }
    alert(round("3,7245"))
    alert(round("3,1245"))
    </script>
      

  3.   

    我上面写成全角了>
    <script>
    function round(n){
    m=Number(n.replace(',','.'))
    return Math.round(m)
    }
    alert(round('3,7245'))
    alert(round('3,1245'))
    </script>
      

  4.   

    But the problem is I don't know whether I should replace the comma to dot all the time. How can I know when I need to replace? Anyway to look into the international setting for the machine running the script? Thank you.
      

  5.   

    alert(round('3.1245'))//also can do,in my function
      

  6.   

    下面的代码,看看你满意不?
    <SCRIPT>
    <!--
    alert(Math.round(eval("2,323.59".replace(",",""))))
    //-->
    </SCRIPT>
      

  7.   

    you function is the same with mine
      

  8.   

    Sorry it is not the thing I want. But anyway, I put an end to it. Thank you very much for your contributions.