修复代币余额的小数位数

时间:2021-07-24 11:08:10

标签: ethereum web3 metamask

你如何获得完全相同的 metamask 值?

enter image description here

因为这会返回 0.001172876571543142

Sub Empty_Area()
    
    Dim rng As Range
    
    Set rng = ThisWorkbook.Worksheets("Sheet1").Range("A1:A10")
    
                            
    If WorksheetFunction.CountA(rng) = 0 Then
        MsgBox "Empty"
    Else
        MsgBox "Not empty"
    End If
                            
End Sub

1 个答案:

答案 0 :(得分:3)

您可以使用 .toFixed() 它还会从您的数字中生成一个字符串

console.log(currentBalance.toFixed(4))