Skip to main content

Notifications

Small and medium business | Business Central, N...
Suggested answer

how to format quantity

Posted on by 115
Hello community, first of all thank you very much for reading my question and taking the time.

I currently have a decimal type variable and I want to give it the following format: 0000000000000.01

Example if my variable brings the amount 1678.32 it would have to be displayed in my text type variable as follows:
00000000001678.32

currently try something like this:
pastedimage1675869008021v1.png

But I can't get the expected result, I get something like this:
'39088.0000000000000'


and it should look something like this:
0000000039088.00

Thank you for your time and I remain attentive to any kind of idea. Thank you and have a good day.


 
  • Suggested answer
    Nitin Verma Profile Picture
    Nitin Verma 21,091 Super User 2024 Season 1 on at
    RE: how to format quantity

    Hi,

    You can try something like this, I am giving you idea, you can write your own logic with the help of below methods and variables.

    length: Integer

    Amt: Text

    length := 8;

    Amt := '39088.00';

    MESSAGE('%1%2',PADSTR('',8,'0'),Amt);

    Answer is - 0000000039088.00

  • Suggested answer
    Marco Mels Profile Picture
    Marco Mels on at
    RE: how to format quantity

    Hello,

    We currently do not have dedicated Dev support via the Dynamics 365 Business Central forums, but I wanted to provide you some additional resources to assist. If you need assistance with debugging or coding I would recommend discussing this on one of our communities.

    www.yammer.com/dynamicsnavdev

    www.dynamicsuser.net/.../14

    I will open this up to the community in case they have something to add.

    Thanks.

  • Yael Suarez Profile Picture
    Yael Suarez 115 on at
    RE: how to format quantity

    Hi I use this:

    PBAMonto := Format(PBATbDiarioPagos.Amount, 0, '<Precision,2:2><Filler Character,0><Integer,13><Filler Character,0><Decimals>');

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

New! Quick response templatesâš¡

Save time with the new custom templates!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,151 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 229,993 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans