Cell Formatting

Posted by: tokenid on 10 September 2017, 10:57 am EST

  • Posted 10 September 2017, 10:57 am EST

    Hello,

     

    I want to format the value in cell. like this.

     

     

        Dim dValue As Double = 123456789.123

        Sheet.Cells(0, 0).Value = dValue

        Sheet.Cells(0, 0).Formatter = New GeneralFormatter("#,##0.00,")    

        Sheet.Cells(1, 0).Value = dValue

        Sheet.Cells(1, 0).Formatter = New GeneralFormatter("#,##0.00,,")   


     

    I want to Sheet.Cells(0, 0).Text = "123,456.79" and Sheet.Cells(1, 0).Text = "123.46" 

    But, both the format that results "123,456,789.12".

    Note that the format string ("#,##0.00,") used above is the Custom NumberFormat used by Excel.

     

    Please, help.

    Thanks.

     

    -------------------------------------

     

    The next results found.

    If I use the format string "#,##0,.00" to get the result I want.

    But, what I want to accept the NumberFormat used by Excel.

    Excel, "#,##0.00," and "#,##0,.00" NumberFormat both support. But you look at the VBA code is  "#,##0.00,". 

     

  • Replied 10 September 2017, 10:57 am EST

    Hello,

    You are right, Spread is not recognizing the  ("#,##0.00,,")   and ("#,##0.00,") formats that you can use in Excel. However you can use ("#,##0,.00") and ("#,##0,,.00") in Excel which is also supported with Spread to get the desired results.

     

    Thanks,

     

  • Replied 10 September 2017, 10:57 am EST

    Hello,

    I want Spread recognizing the ("#,##0.00,,") and ("#,##0.00,") formats.

    Because NumberFormat return only ("#,##0.00,,") in Excel.

     

    >> Excel VBA 

     Sub Macro1()

        Range("A1").Select

        ActiveCell.FormulaR1C1 = "123456789.1234"

        Selection.NumberFormat = "#,##0,,.00"

        

        '//This result is "#,##0.00,,".

        '//NumberFormat Changed!!!

        Debug.Print Selection.NumberFormat

    End Sub

     
     
    http://me2.do/Fj6ulOM
     
     
    Thanks.   ^^;
  • Replied 10 September 2017, 10:57 am EST

    Hello,

    I have submitted this issue as a bug. The bug id for this issue is #2385, hope this issue will be fixed in our next build of Spread for Silverlight/WPF.

     

    Thanks,

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels