Forum Discussion

MikeKlausing's avatar
MikeKlausing
Qrew Assistant Captain
5 years ago

Add decimals to the right of a text field

I have a formula converting numbers to a list of text. I need it to display a list of amounts vertically. Everything is working properly including the "$" out front. The last thing I am needing to place is ".00" at the end of each of these fields to show the decimal places. 

"<span style=\"font-size:11px;\">" &
"<b>" &
"<span style=\"text-decoration:underline;\">" &
"<p style=\"text-align: Right;\">" &


var text VerticalList =
(List
(" <br />",
ToText([Cost Notes]),
ToText([Note 2 Cost]),
ToText([Note 3 Cost]),
ToText([Note 4 Cost])));

If($VerticalList <> "",
"$"
& $VerticalList)


&"</p>"
& "</span>"
& "</b>"
& "</span>"

------------------------------
Mike Klausing
------------------------------

4 Replies

  • Hi Mike, I tried your formula in a Rich Text field. All you need to update is this:

    ToText([Cost Notes]) &".00",
    ToText([Note 2 Cost]) &".00",
    ToText([Note 3 Cost]) &".00",
    ToText([Note 4 Cost]) &".00"));


    ------------------------------
    Lisa Sell
    ------------------------------
    • MikeKlausing's avatar
      MikeKlausing
      Qrew Assistant Captain
      Lisa, 

      Thank you for your response. I forgot to clarify in my original question that any or all of these fields may be blank. So if they are null then the ".00" will still show up and I need that to only show up if there is a value in that particular field.

      ------------------------------
      Mike Klausing
      ------------------------------
      • LisaSell1's avatar
        LisaSell1
        Qrew Trainee
        This works on my test report. I'm sure there are better ways to do this, but here is my update:
        "<span style=\"font-size:11px;\">" &
        "<b>" &
        "<span style=\"text-decoration:underline;\">" &
        "<p style=\"text-align: Right;\">" &

        var text costnote =ToText([Cost Notes])&".00";
        var text notetwo =ToText([Note 2 Cost])&".00";
        var text notethree =ToText([Note 2 Cost])&".00";
        var text notefour =ToText([Note 2 Cost])&".00";

        var text VerticalList =
        (List
        (" <br />",
        $costnote,
        $notetwo,
        $notethree,
        $notefour
        ));

        If([Cost Notes]>0,

        //$VerticalList <> "",
        "$"
        & $VerticalList)


        &"</p>"
        & "</span>"
        & "</b>"
        & "</span>"

        ------------------------------
        Lisa Sell
        ------------------------------