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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Handling no of decimal points when writing Table records to a text file

(0) ShareShare
ReportReport
Posted on by 364

Hello all,

I need to control the no of decimal points of a real field when we are exporting the records  from table to a text file. For which i have created an Real EDT with no  of decimal points to 2.

When we open the table, the records are displayed with 2 decimal points. However when the records are exported to text file, the Real field is showing more than 2 decimal points.

Can you please help me in handling the decimal place when we export the records to a text file.

Thank you.

Venkat

*This post is locked for comments

I have the same question (0)
  • nmaenpaa Profile Picture
    101,166 Moderator on at

    How do you export? Do you have some code that does it?

    It would be great if you could share your code since otherwise it's very difficult for us to know what's wrong with it.

  • Venkatdax0 Profile Picture
    364 on at

    Below is the code which am using to write the data from table to Text file, where for the AccountAmountCr field i have created an EDT.

    iOWrite = new TextIo(fileName,#IO_Write);

    iOWrite.outFieldDelimiter(',');

    while select * from RWFileTmp            

           {

               if(firstWrite)

               {

                   iOWrite.writeExp(recordHeaderLine);

                   firstWrite = false;

               }

               recordWrite =[RWFileTmp.LineIdentifier,RWFileTmp.MainAccount,RWFileTmp.Description,RWFileTmp.AccountingAmountCr];

               iOWrite.writeExp(recordWrite);

           }

  • Suggested answer
    Rudi Hansen Profile Picture
    4,079 on at

    Look at The num2str functions.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Joris dG Profile Picture

Joris dG 5

#2
Andrew Jones a1x Profile Picture

Andrew Jones a1x 2

#3
Basit Profile Picture

Basit 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans