跳至主內容

搜尋

搜尋

Formatnumber(14.89,0) Is Rounding To 15

評論

1 條評論

  • Avatar
    Michael Toupin (mtoupin

    Yes, that's correct.  What FormatNumber does is rounds to the nearest digit, and adds commas at each thousandths place ( so FormatNumber(12345.678,2) would result in 12,345.68).  FormatCurrency works the same way, but with the addition of a currency symbol at the beginning of the number.  Setting the number of decimal places to 0 will result in a rounded whole number.

     

    If your intention is to just show the whole number, you'd want to use a script like value = mid(data, 1, (instr(data,".") - 1)).  This will just delete anything from the decimal point on.  

    0

登入寫評論。