Skip to main content
Question

Losing Number Format in Rich Text Formula

  • February 5, 2021
  • 0 replies
  • 172 views

Forum|alt.badge.img+3
I found a few references to my issue in old posts but the links all seem to be dead.

I'm trying to display the value of a currency field [PO Subtotal] in a rich text formula field. The number displays but drops the number formatting I have setup on the [PO Subtotal] field, leaving me with either 1 or no decimal points depending on the situation. How can I force two decimal points in a rich text formula field? [PO Subtotal] displays with 2 decimal points outside this rich text field.

I feel like I'm missing something simple but after checking the display options for every field involved in this, I'm out of ideas and above all frustrated when all the (seemingly) relevant QB Community links are broken.

Below is the entire code from the rich text formula field.

"
<table align=\"right\" border=\"0\" cellpadding=\"1\" cellspacing=\"1\" style=\"width:820px;\">
  <tbody>
    <tr>
      <td style=\"width: 70%;\">&nbsp;&nbsp;</td>
      <td style=\"text-align: right;\">
        <p>Subtotal</p>
        <p>HST (13%)</p>
        <p>Invoice Total</p>
        <p>Total Payments</p>
		<p>Balance Due</p></td>
      <td>
        <p style=\"text-align: right;\">" & [PO Subtotal] & "</p>
        <p style=\"text-align: right;\">" & [Tax] & "</p>
        <p style=\"text-align: right;\">" & [Total] & "</p>
        <p style=\"text-align: right;\">" & [Total Payments] & "</p>
        <p style=\"text-align: right;\">" & [Balance] & "</p>
      </td>
    </tr>
  </tbody>
</table>
"​


------------------------------
Matt Hardy
------------------------------
This topic has been closed for replies.

MarkShnierYou
Forum|alt.badge.img+24
Here is a formula that probably works to convert the number to a text string with decimals.

var text txtRounded = ToFormattedText(Round([yourvalue]*100,0.01),"none_dot");
var number wheredot=If(Contains($txtRounded,"."),Length(Right($txtRounded,".")),0);
var text fmtnbr = If($wheredot = 0, $txtRounded & ".00", If($wheredot = 1, $txtRounded & "0", $txtRounded)) ;

------------------------------
Mark Shnier (YQC)
Quick Base Solution Provider
Your Quick Base Coach
http://QuickBaseCoach.com
mark.shnier@gmail.com
------------------------------