Decimal number format

monteiromonteiro Member Posts: 26
Hi everybody!

I tried to format a decimal number to get "76543.21" using:

FORMAT("Credit Limit LCY)",0,'<Integer><Decimals><1000Character,.>')

This is the Navision help file syntax, but not working... the result was: "76543,21" (comma instead of dot). And if I have "zero", the result is only "0" but I need "0.00".

What's the correct syntax?


Thanks in advance,

Monteiro
Monteiro, Rodrigo
www.draeger-medical.com

Answers

  • jannestigjannestig Member Posts: 1,000
    Where is this display being sent to ? Is it for a report or is it in a form.

    If you look at the properties value of the field you can set it to always appear as 2 decimal places which i believe is what you want ?
  • monteiromonteiro Member Posts: 26
    Hi jannestig,

    It's a dataport code. I have a DataItem (Customer table). I can't choose the fields properties... see that:

    T_LIMITE_CREDITO := FORMAT("Credit Limit (LCY)",0,'<Integer><Decimals><1000Character,.>');


    Thanks,

    Monteiro
    Monteiro, Rodrigo
    www.draeger-medical.com
  • jannestigjannestig Member Posts: 1,000
    IF you search in Mibuso for Decimal rounding solutions

    this one looked llike what you want.

    MESSAGE('%1',FORMAT(10000.1,0,'<Precision,2:2><Standard Format,2>'));
  • monteiromonteiro Member Posts: 26
    jannestig,

    This is what I was looking for. Thank you so much!



    Regards,

    Monteiro
    Monteiro, Rodrigo
    www.draeger-medical.com
  • Rishi1109Rishi1109 Member Posts: 43
    If you simply change the DecimalPlaces Property of the field in Table then also it will work
    Thanks and Regards
    Rishi
  • MichelDant77MichelDant77 Member Posts: 4
    jannestig wrote: »
    IF you search in Mibuso for Decimal rounding solutions

    this one looked llike what you want.

    MESSAGE('%1',FORMAT(10000.1,0,'<Precision,2:2><Standard Format,2>'));

    Great, you saved me!
Sign In or Register to comment.