Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Answered

Rounding to 2 decimal digits i

(0) ShareShare
ReportReport
Posted on by 90

I want to get the amount with vat with two decimal digits but without rounding for example if i have 8521.0055 i want to get 8521.00 

I did some search and found that I can use format for that but it keeps giving me error.

Can someone help me with that 

  • Suggested answer
    Nitin Verma Profile Picture
    21,565 Moderator on at
    RE: Rounding to 2 decimal digits i

    Hi muaz deyab ,

    As per the code I sent it will always round the values by seeking its decimal places, means it will increase or decrease accordingly, but as you said you want exact same 2 decimal values, in that case you have to use below logic

    TextVal := FORMAT(8521.3160);

    IF STRPOS(TextVal ,'.') > 0 then

     TextVal := COPYSTR(TextVal,1,STRPOS(TextVal,'.')) + COPYSTR(TextVal,STRPOS(TextVal,'.')+1,2);

  • muaz deyab Profile Picture
    90 on at
    RE: Rounding to 2 decimal digits i

    Thanks for ur answer it really helped me but when i enter 8521.3160 it gives me 8521.32 i want to get the exact same two decimal digits (8521.31).

    So I converted the Total Amount to text then deleted everything after two decimal digits

               TxtAmount := Format(TotalAmount);

               POS := StrPos(TxtAmount, '.');

               Evaluate(AmountWithVAT, TxtAmount.Remove((POS + 3)));

    this is the code

    and thank you for your answer again

  • Suggested answer
    Nitin Verma Profile Picture
    21,565 Moderator on at
    RE: Rounding to 2 decimal digits i

    Yes it will return as a text

  • muaz deyab Profile Picture
    90 on at
    RE: Rounding to 2 decimal digits i

    this will return a text right?

  • Suggested answer
    Nitin Verma Profile Picture
    21,565 Moderator on at
    RE: Rounding to 2 decimal digits i

    Also please try below

    FORMAT(ROUND(8521.0055,0.1),0,'<Precision,2><sign><Integer Thousand><Decimals,3>')

    Thanks.

  • Suggested answer
    Nitin Verma Profile Picture
    21,565 Moderator on at
    RE: Rounding to 2 decimal digits i

    Hi muaz deyab ,

    Please try below rounding function.

    ROUND(8521.0055,0.1)

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

Jainam Kothari – Community Spotlight

We are honored to recognize Jainam Kothari as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard >

Featured topics

Product updates

Dynamics 365 release plans