Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX (Archived)

Positive pay CSV file not respecting number format

(0) ShareShare
ReportReport
Posted on by 1,433

I used this link: https://community.dynamics.com/ax/b/axatoz/archive/2019/03/07/d365-positive-pay-file-wells-fargo to create my file for the positive pay format and to do the extension on BankPositivePayExport to replace the default XML-output type with a CSV-output type.

The file is generated as a CSV-file and I am presented with that to save or open.

When I open the file using Notepad, the number formatting is respected. However when I open it in Excel, it throws away the trailing zeroes.

I need to show $30 as 30.00 and it does in notepad, but once opened in Excel, it shows as just: 30.

/* Snippet out of my positive pay file:

 <xsl:variable name="amtdec" select="AMOUNTCUR" />
 <xsl:value-of select="format-number($amtdec, '#.00')" />

1643.pp1.jpg

Opened in Excel:

31327.pp2.jpg

Also look at the 1286.9 that shows in Notepad correct as 1286.90

My whole file:

<xsl:stylesheet version="1.0"
                xmlns:xsl="www.w3.org/.../Transform"
                xmlns:msxsl="urn:schemas-microsoft-com:xslt"
                exclude-result-prefixes="msxsl xslthelper"
                xmlns="urn:iso:std:iso:20022:tech:xsd:pain.001.001.02"
                xmlns:xsi="www.w3.org/.../XMLSchema-instance"
                xmlns:xslthelper="schemas.microsoft.com/.../xslthelper">
  <xsl:output method="text" omit-xml-declaration="yes" version="1.0" encoding="utf-8"/>
  <xsl:template match="/">
    <xsl:value-of select="''" />
    <Document>
      <xsl:value-of select="''" />

      <xsl:for-each select="Document/BANKPOSITIVEPAYEXPORTENTITY">

        <!--Cheque Detail begin-->
      <xsl:value-of select="ACCOUNTNUM/text()"/>
      <xsl:value-of select='string(",")'/>
      <xsl:value-of select='string("Reg")'/>
      <xsl:value-of select='string(",")'/>
      <xsl:variable name="amtdec" select="AMOUNTCUR" />
      <xsl:value-of select="format-number($amtdec, '#.00')" />
      <xsl:value-of select='string(",")'/>
      <xsl:value-of select="normalize-space(CHEQUENUM/text())"/>
      <xsl:value-of select='string(",")'/>
      <xsl:variable name="year" select="substring(TRANSDATE/text(),1,4)" />
      <xsl:variable name="month" select="substring(TRANSDATE/text(),6,2)" />
      <xsl:variable name="day" select="substring(TRANSDATE/text(),9,2)" />
      <xsl:value-of select="concat($day,'/',$month,'/',$year)" />
      <xsl:text>&#13;&#10;</xsl:text>
      </xsl:for-each>
    </Document>
  </xsl:template>
</xsl:stylesheet>

*This post is locked for comments

  • Suggested answer
    nmaenpaa Profile Picture
    nmaenpaa 101,156 on at
    RE: Positive pay CSV file not respecting number format

    CSV is just text (no formatting), so Excel needs to guess how it should be formatted, and it doesn't always guess right. So you need to tell it what kind of formatting you want.

    As you see in notepad, the number in the file is correct. Your problem is in the formatting settings of Excel (not related to AX or the file), you need to change them for this column.

  • Suggested answer
    BrandonSA Profile Picture
    BrandonSA 1,669 on at
    RE: Positive pay CSV file not respecting number format

    Hi

    You probably need to format the column in Excel. You might need to configure how many decimal values are displayed. What is the current format in Excel of that column?

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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Congratulations to the January Top 10 leaders!

Check out the January community rock stars...

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,187 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,966 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans