Skip to main content

Notifications

Microsoft Dynamics AX (Archived)
Answered

When I do a select my numeric value have a dot as decimal

Posted on by 1,867

Hi.

When I open a form  with a numeric value decimal comes with comma and thousands with dot like 1.000,03.

But when I do a select with X++ values shows differents, last example looks like 1000.03, what is the reason for this?Because I'm having problems with a export file.

Thanks for hepl.

*This post is locked for comments

  • XB Profile Picture
    XB 1,867 on at
    RE: When I do a select my numeric value have a dot as decimal

    Thanks Andree.

    Finally we'll export all file as string , user prefer that before have to use DMF.

  • Verified answer
    André Arnaud de Calavon Profile Picture
    André Arnaud de Cal... 291,151 Super User 2024 Season 2 on at
    RE: When I do a select my numeric value have a dot as decimal

    Hi Javier,

    Your initial question was tagged with "CSV". CSV is a text format. What exact class are you using for exporting the file?

    Have you also looked at Data Import/Export Framework?

  • XB Profile Picture
    XB 1,867 on at
    RE: When I do a select my numeric value have a dot as decimal

    Hi Israel.

    I see "es", all config are in spanish.

  • Israel Gonzalez Profile Picture
    Israel Gonzalez 708 on at
    RE: When I do a select my numeric value have a dot as decimal

    If you print CompanyInfo::find().LanguageId what do you see?

  • XB Profile Picture
    XB 1,867 on at
    RE: When I do a select my numeric value have a dot as decimal

    Yeah, I check on Ax and machine on server, both have the same configuration "es", I checked language, keyboard..

  • Israel Gonzalez Profile Picture
    Israel Gonzalez 708 on at
    RE: When I do a select my numeric value have a dot as decimal

    Hi Javier,

    Did you check the regional configuration in your machine and the server?

  • XB Profile Picture
    XB 1,867 on at
    RE: When I do a select my numeric value have a dot as decimal

    The problem is that I don't wanna save as string, if I use num2str the value will be converted to string and it 'll show with quotes..

    Look at the first red column on images.

    8508.1.png

  • André Arnaud de Calavon Profile Picture
    André Arnaud de Cal... 291,151 Super User 2024 Season 2 on at
    RE: When I do a select my numeric value have a dot as decimal

    Hi Javier,

    You can use the function num2str() to define the thousands and decimal separator. As mentioned the point is used within AX internally. If you don't specify the user preference in coding, it will not convert it as per your preferences.

  • XB Profile Picture
    XB 1,867 on at
    RE: When I do a select my numeric value have a dot as decimal

    8764.1.png

  • XB Profile Picture
    XB 1,867 on at
    RE: When I do a select my numeric value have a dot as decimal

    Here's my code

    commaTextIo = new CommaTextIo(fileName, "w");

    while (qr.next())

    {

                   generalJournalEntry = qr.get(tableNum(generalJournalEntry));

                   generalJournalAccountEntry = qr.get(tableNum(generalJournalAccountEntry));

                   commaTextIo.write(generalJournalAccountEntry.LedgerAccount, generalJournalEntry.SubledgerVoucher, generalJournalAccountEntry.AccountingCurrencyAmount, generalJournalEntry.AccountingDate, generalJournalAccountEntry.text, generalJournalAccountEntry.TransactionCurrencyAmount, generalJournalAccountEntry.TransactionCurrencyCode);

    }

    AS you can see I'm not converting numeric to strings...I try with AsciiIo ,textIo event System.io.streamwriter...and I always have the same problem.

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