Integer field format problem

ptijsmaptijsma Member Posts: 17
Hello,

One of our customers uses quantities of 10000 and higher but the field in de database is of datatype integer.
No problem because this is what it should be. The only thing is that on the form i want to display it as 10.000 (with the dot for thousand seperator)
I've been searching for a while using the Format property of the textfield, using the format function but had no luck so far.

The best thing would be to have default (display)format with the thousand seperator defined on table level.

Can anyone help me out here ?

Thanks in advance

Peter Tijsma

Comments

  • kinekine Member Posts: 12,562
    What about set Local (Regional) settings in control panel? (separator)
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • ptijsmaptijsma Member Posts: 17
    kine wrote:
    What about set Local (Regional) settings in control panel? (separator)

    Nope, this is already setup correctly. With Decimal fields its not a problem. Its only the Integer fields that don't work
  • ZackMacKrackenZackMacKracken Member Posts: 12
    You have ton use the regional and language settings of you operating system to setup the format of your choice.

    Regards
    Zack
  • ptijsmaptijsma Member Posts: 17
    You have ton use the regional and language settings of you operating system to setup the format of your choice.

    Regards
    Zack

    This is all correctly setup on the system (Numbers with thousand seperator) within the Regional Settings
    The problem is with the Integer Datatype formatting
  • PEzechielsPEzechiels Member Posts: 83
    What you can try is to define a global (type decimal).
    Put the global on the form and fill it with the integer field.
    In the properties you should set decimal places 2:0
    Hope this helps you
  • ptijsmaptijsma Member Posts: 17
    PEzechiels wrote:
    What you can try is to define a global (type decimal).
    Put the global on the form and fill it with the integer field.
    In the properties you should set decimal places 2:0
    Hope this helps you

    Thanks, i'll try that tomorrow.!
  • 2tje2tje Member Posts: 80
    in the property SourceExpr fill in the field, followed by: / 1000
    (it will show the decimal seperator, but that might be good enough)
  • kinekine Member Posts: 12,562
    What about <Sign><Integer Thousand> in format exression?
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • ptijsmaptijsma Member Posts: 17
    kine wrote:
    What about <Sign><Integer Thousand> in format exression?

    This is what i thought at first, but strangely enough, when i do that, it won't show anything anymore
  • ajhvdbajhvdb Member Posts: 672
    So none of the above solutions work?
  • ptijsmaptijsma Member Posts: 17
    ajhvdb wrote:
    So none of the above solutions work?

    I haven't tried the Global Decimal variable yet, but i suppose that will work

    I do think thoug, that there should be a way to set it up on table level so it will show the same troughout the system.
  • ErictPErictP Member Posts: 164
    Perhaps you can use this.

    In the OnFormat trigger of the textbox create a variable from type decimal.

    OnFormat=
    VAR
    dDecimal@1000000000 : Decimal;
    BEGIN
    EVALUATE(dDecimal,Text);
    Text := FORMAT(dDecimal);
    END;
    }
  • RobertMoRobertMo Member Posts: 484
    Following should work:
    Open form in designer and set Format property for TextBox that displays your integer field/global:
    <Sign><Integer><1000character,.>
    
    I have tested for both sources: an integer table field or an integer global as source.
               ®obi           
    ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
  • ptijsmaptijsma Member Posts: 17
    RobertMo wrote:
    Following should work:
    Open form in designer and set Format property for TextBox that displays your integer field/global:
    <Sign><Integer><1000character,.>
    
    I have tested for both sources: an integer table field or an integer global as source.

    THANK YOU! You saved my live.
    This is the best solution yet.

    But... I still believe that it should be possible on table level.
  • RobertMoRobertMo Member Posts: 484
    ptijsma wrote:
    THANK YOU! You saved my life.
    Then you owe me a beer. A big one. And not Heineken.
               ®obi           
    ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
  • ptijsmaptijsma Member Posts: 17
    RobertMo wrote:
    ptijsma wrote:
    THANK YOU! You saved my life.
    Then you owe me a beer. A big one. And not Heineken.

    Ok.... Amstel Beer then :wink:
Sign In or Register to comment.