none
Split the numeric format RRS feed

  • Question

  • Wondering if there is any way to split the numeric format .i.e

    total =   1234567.89   

    I need to show this way

    total = 1.234.567,89

    But I don't want to modify the table, there is any way to do that directly into the report??

    thanks

    Nelson
    Wednesday, August 13, 2008 2:52 PM

All replies

  • I'm not going to ask why your doing that, hehe, looks interesting.  Anyways, to do it via expression would probably be a bit of a pain.  I'd write a VB function to do it and just include it with the report. 


    So the expression would equal

    =Code.FormatNumber(Fields!Number.Value)


    "Code" of course calls the code section of  the report

    "FormatNumber" would equal the name of your VB method

    and "(Fields!Number.Value)" would be the parameter you past to your method


    VB has some great string parsing abilities, so you should be able to do what you need by using that functionality.


    To get to the Code area of your report, just open the report to the designer, right click in the blank area below, choose properties, then click on the code tab, paste in your VB function.

    I'd advise building the function in some test project or something, that way you can be sure it works and have all the compilier help of VS studios...then just paste it in once you got it right.


    Living my life at 123mph in 11.15 seconds
    Wednesday, August 13, 2008 3:19 PM
  • could you tell me how that code could be please
    thanks
    Wednesday, August 13, 2008 4:35 PM
  •  HI, Nelson,

    Did you mean 1,234,567.89 instead of 1.234.567,89?

    Let me know if I'm wrong.

    Please set your format property to =Format("#,###.#0") and see if it works for you.

    Good luck,

    Long

    Wednesday, August 13, 2008 5:43 PM
  • yeah is Long right? or do you really want   1.234.567,89

    because if you really want that, then you'll need to use VB string functions as best I can tell.

    The code to do it is not something I've got the time to think up.
    Living my life at 123mph in 11.15 seconds
    Wednesday, August 13, 2008 6:50 PM
  • Hello neneko56

    write this in the Format-Property of your Textfield that you want to modify: #,###.#0

    Your Textfield must be fillt with a numerical Value. IMHO.
    You can test it with a normal Textbox. Set the Value =  '=cdbl(1234567.89)'. Without ' . And set the Format-Property.

    Then you get your Result: 1.234.567,89


    HTH, Bandittreiber
    Thursday, August 14, 2008 6:08 AM
  • pretty cool bandit,  I'm terrible with those formatting tricks.
    Living my life at 123mph in 11.15 seconds
    Thursday, August 14, 2008 9:03 PM