Looking for Format String to switch from Comma to Dot

Hey Guys,

i get a Decimal Value as Text, for the European Format it Looks great, but there is an US Company in the same DB, and i want only to Change the Values (from 1.000,10 to 1,000.10)

I try to use the Format Funktion, but it didn't work :-(

Answers

  • SanderDkSanderDk Member Posts: 502
    Hi @Martin_Förster
    You can have a look at DELCHR function:
    https://docs.microsoft.com/en-us/dynamics-nav/delchr-function--code--text-

    First convert the "," to a different char, then you change "." to a "," and convert your "," to "."
    :smile:

    If you got the company in the same DB remember to check which format to convert to :smile:
    For help, do not use PM, use forum instead, perhaps other people have the same question, or better answers.
  • vaprogvaprog Member Posts: 1,144
    You can use FORMAT with a customized format string, or, better, set the correct language before you use format. Unfortunately this is only available in a non-intrusive way in reports. Everywhere else you needed to change the global language.

    With FORMAT you can use (in any language)
    MESSAGE('%1',FORMAT(355/113* 10000,0,'<Sign><Integer Thousand><1000Character,,><Decimals><Comma,.>'));
    
    which results in
    Microsoft Dynamics NAV
    ---------------------------
    
    31,415.929203539823
    ---------------------------
    OK
    ---------------------------
    
  • vaprogvaprog Member Posts: 1,144
    ... and in case you need to control the number of decimal places, prepend '<Precision,2:2>' to the entire format string, making it
    '<Precision,2:2><Sign><Integer Thousand><1000Character,,><Decimals><Comma,.>'
    
Sign In or Register to comment.