Forum Discussion

Phishdawg's avatar
Phishdawg
Brass Contributor
Jan 25, 2025

Show Number Values as Currency


I have a Word template with a repeating table in which are fields intended for currency.

I am trying to figure out how to dynamically apply the '$' and show the decimal placing so that content looks like -
     $1,345.70

In the below, I hardcoded (typed in) the $ between the label and the plain text content control. Not sure if
this is the actual answer.

 

3 Replies

  • AlexEncodian's avatar
    AlexEncodian
    Copper Contributor

    You could format string values in your JSON and populate the table with "$3.26" instead of 3.26 floats. But would require some manipulation of your data inside your flow.

    You can use formatters in your template using Encodian as an alternative:

    https://support.encodian.com/hc/en-gb/articles/360020648597-Expression-Results-and-Formatting#h_01J4HN722RSVFWS4MNJZ3N3HTC

    There's a https://support.encodian.com/hc/en-gb/community/topics/18049574288796-Template-Design community forum where the Encodian support team helps fix your templates.

  • AlexEncodian's avatar
    AlexEncodian
    Copper Contributor

    You could format the values as a string in Power Automate and insert them as string values? "$3.26"

    It would require some manipulation of data in your flow. Using Encodian, you could format any values using template syntax (dates, currencies, strings, numbers, etc):

    https://support.encodian.com/hc/en-gb/articles/360020648597-Expression-Results-and-Formatting#h_01J4HN722RSVFWS4MNJZ3N3HTC



    There's a forum where Encodian support will fix your templates: https://support.encodian.com/hc/en-gb/community/topics/18049574288796-Template-Design

  • Try this out:

     

    • Using Fields:
      • Place the cursor where you want the currency value to appear.
      • Press Ctrl+F9 to insert a field.
      • Type = and then the value or reference to the field containing the number.
      • Press Shift+F9 to toggle between the field code and its value.
      • You can add formatting codes to the field like { =1234.56 \# "$#,##0.00" }.
    • Using Content Controls with Macros:
      • Insert Plain Text Content Control where you want the currency to appear, but don't type the dollar sign ($) manually.
      • Use a Macro to format these fields. Here is a sample VBA code that formats content controls as currency:
    Sub FormatCurrency()
        For Each cc In ActiveDocument.ContentControls
            If cc.Type = wdContentControlText Then
                If IsNumeric(cc.Range.Text) Then
                    cc.Range.Text = Format(cc.Range.Text, "$#,##0.00")
                End If
            End If
        Next cc
    End Sub
    

     

    • Using Quick Parts:
      • Go to Insert -> Quick Parts -> Field.
      • Select Field Codes... and type in the currency formatting you need.
      • Save the Quick Part for future use.

     

     

Resources