web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Changing value from Real to Int

(0) ShareShare
ReportReport
Posted on by 3,110

Realto-Int.png

Dear Members,

I am now working on SSRS report in that the value of "Price" Column in Real data type. But i want to show that real data type in int for example instead of 7.66 shows 8 simple.

Thanks in Advance

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    startax Profile Picture
    1,845 on at
    RE: Changing value from Real to Int

    Hi,

    Use " Round(2004.5, System.MidpointRounding.AwayFromZero) " expression or you can also use " string.Format("{0:#,###}",Round(Fields!dw_value.Value,0)) "

  • Suggested answer
    Community Member Profile Picture
    on at
    RE: Changing value from Real to Int

    Hi Shabir,

    The only thing you can do, is use a round function, if the value is less than .5 the round function will be return 0, and if the value is higher than .5 the function will return 1. You need to use the function in your class that is mapping that field in the temporary table. The standard function:

    static void Job1(Args _args)

    {

       int i, ii;

       real r = 334.55, r2 = 334.14;

       ;

       i = decround(r, 0);

       ii = decround(r2, 0);

       // It shows 335, 334

       info(strfmt("%1, %2", i, ii));

    }

    You can use that example.

    Thanks!

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Andrés Arias – Community Spotlight

We are honored to recognize Andrés Arias as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Syed Haris Shah Profile Picture

Syed Haris Shah 9

#2
Mea_ Profile Picture

Mea_ 4

#3
Community Member Profile Picture

Community Member 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans