Jump to content
  • 0

Decimal Points For {Transaction.amount} In Emails.


Jason

Question

I can't seem to keep Blesta from using four decimal places in the "Email Template Payment Received (Non-Merchant)" email. 

 

Right now if a person pays $25.00 it will send the email with four decimals so it looks like this $25.0000. I want it to only show two decimal places. Under currency I have the precision set to 2, but for this it shows 4 decimal places. 

 

I am sure it is an easy fix with PHP, but I don't know where this particular number is pulled from.

Any help you can provide would be appreciated,

--Jason

Link to comment
Share on other sites

9 answers to this question

Recommended Posts

  • 0
1 hour ago, Jason said:

I am currently using the tag {transaction.amount} for the emails. If I knew where that tag was generated I could use something like "number_format" to change it to only 2 decimal places, but unfortunately I don't know which file that data is generated from.

Thanks,
--Jason

I provided you this tag:

{transaction.amount | currency_format transaction.currency}

Which converts it from $24.0000 to $24.00

Link to comment
Share on other sites

  • 0

I don't believe this a bug it's just how the system works we use:

{transaction.amount | currency_format transaction.currency}

Tyson told us ages ago on a thread but I can't find it so that's it. Maybe a feature request or something to put that in by default?

 

So like:

Hello {contact.first_name},

Thank you for your recent payment of {transaction.amount | currency_format transaction.currency} via {transaction.gateway_name}.

Your transaction number for this payment is {transaction.transaction_id}.

For your reference we recieved your payment on the {date_added}.
Link to comment
Share on other sites

  • 0

I am currently using the tag {transaction.amount} for the emails. If I knew where that tag was generated I could use something like "number_format" to change it to only 2 decimal places, but unfortunately I don't know which file that data is generated from.

Thanks,
--Jason

Link to comment
Share on other sites

  • 0
1 hour ago, Licensecart said:

I provided you this tag:


{transaction.amount | currency_format transaction.currency}

Which converts it from $24.0000 to $24.00

I suggest using this for now. It's CORE-1092 which I think will resolve this globally by utilizing the currency format for the currency code. If it's a 2 decimal currency, will effectively round to 2 decimals. If it's a currency with no decimals like Japanese Yen, then it would be rounded to an integer.

Link to comment
Share on other sites

  • 0
On 8/11/2016 at 10:24 AM, Licensecart said:

I provided you this tag:


{transaction.amount | currency_format transaction.currency}

Which converts it from $24.0000 to $24.00

Thanks Licensecart and Paul. I didn't realize the extra part of the tag was actually formatting info. I used the tag as you listed it and the email sends out the correct decimal points now. I appreciate your help and your patience!!!!!

Link to comment
Share on other sites

  • 0
2 hours ago, Jason said:

Thanks Licensecart and Paul. I didn't realize the extra part of the tag was actually formatting info. I used the tag as you listed it and the email sends out the correct decimal points now. I appreciate your help and your patience!!!!!

You're welcome :) it's because it's a h2o tag so the last bit corrects what we need :D

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...