1

I need have the Amount field formatted like ${0,number,##,##0.00} in the URL within outputLink. How can this be written?

<apex:outputLink value="http://www.bjp-studios.com/submit-payment/?tfa_6={!relatedTo.Amount}&tfa_13={!relatedTo.Id}">Pay Now</apex:outputLink>
5
  • 4
    Why would you care about number formatting in a link. That doesn't make a ton of sense.
    – Adrian Larson
    Sep 10, 2016 at 20:18
  • The URL is receiving the value and displaying it to the user. I want $125.00 instead of what is coming over now - 125.0 Where it makes sense or not, is it possible?
    – Ben Jones
    Sep 11, 2016 at 2:19
  • 1
    Do you have an Apex controller on your page? If so you have options. NB that you should be careful about escaping output pulled in from url parameters.
    – Adrian Larson
    Sep 11, 2016 at 3:33
  • I don't. This code is in a Visualforce email template.
    – Ben Jones
    Sep 11, 2016 at 12:31
  • Have you tried using outputText along with params? That would seem to be the only way of accomplishing what you're looking for.
    – crmprogdev
    Sep 11, 2016 at 14:52

1 Answer 1

0

Try in the following manner

<apex:outputText value=" ${0,number,##,##0.00}" onclick="http://www.bjp-studios.com/submit-payment/?tfa_6={!relatedTo.Amount}&tfa_13={!relatedTo.Id}">
<apex:param value="{!amtFieldValue}"/>

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .