Calculated Field to display Text and Dollar Amounts - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Calculated Field to display Text and Dollar Amounts

Last post 06-14-2016 09:44 AM by Hilary Stoupa. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 06-07-2016 11:48 AM

    • tdorsi
    • Not Ranked
    • Joined on 06-07-2016
    • Posts 2

    Calculated Field to display Text and Dollar Amounts

     Hello,

    First off this forum has been a tremendous help. I am very new to InfoPath and learning on the fly so to speak :P

    I am running into an issue when attempting display a Message to the user in the form. I have created a Calculated Text Field on the form that will display the following message:

    The Time spent to correct this issue was 2 hours and 15 minutes. For an estimated cost of $45.90

    I am using the Concat Function

    I am getting the values for this expression from 3 fields: [DevHours] , [DevMinutes] and Dev_Cost

    The first two fields are displaying fine the last field [Dev_Cost] which is a Number field set by a form rule Displays in the message as 45.900000000000000000001

    I figured out how to Round the Cost but I was asked to diplay the actual amount with the 2 decimal places.

    I found the following post  

    http://www.infopathdev.com/blogs/jimmy/archive/2012/08/10/xpath-tips-and-tricks-rounding-numbers-to-the-nearest-n.aspx

    Which is a big help but I am still running into an error.

    Here is my current formula

    concat("Total time spent to correct this issue was ", DevHours, " hours and ", string(DevMinutes), " minutes. For an Estimated cost of $", round(Dev_Cost)*100/100)

    Here is the return code error:

    The expression is not a node-set.
    concat("Total time spent to correct this issue was ", dfs:dataFields/my:SharePointListItem_RW/my:DevHours, " hours and ", string(dfs:dataFields/my:SharePointListItem_RW/my:DevMinutes), " minutes. For an Estimated cost of $", round(dfs:dataFields/my:SharePointListItem_RW/my:Dev_Cost)*-->100<--/100)

    Any and all assistance and guidance is greatly appreciated

     

  • 06-14-2016 09:44 AM In reply to

    Re: Calculated Field to display Text and Dollar Amounts

    I am kinda lazy. I'd use two expression boxes for this - one that shows all of the text up to the $ sign, then another that is just the Dev_Cost field, formatted as currency & set to display two decimal places.
    Hilary Stoupa

Page 1 of 1 (2 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.