locked
How to display exponents 10^9 RRS feed

  • Question

  • Hi, 

    How can a display the  following number 10^9 in a SSRS report?

    66100000000.0000000000 /L 

    Would like to display it in the report as 66.1x10^9.

    Monday, November 30, 2020 7:12 PM

All replies

  • Sub test()
    Dim sNum As String
    Dim sExp As String
        sNum = "66100000000.0000000000"
        sExp = fnExp(sNum)
        MsgBox sNum & vbNewLine & sExp
    End Sub
    
    Function fnExp(strNum As String) As String
    Dim vArr
    Dim dblNum As Double
        dblNum = Val(strNum)
        vArr = Split(Format(dblNum, "Scientific"), "+")
        fnExp = 10 * Val(vArr(0)) & "x10^" & Val(vArr(1)) - 1
    End Function

    Tuesday, December 1, 2020 5:27 PM