Jump to content

Question

Posted

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

9 answers to this question

Recommended Posts

  • 0
Posted
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

  • 0
Posted

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}.
  • 0
Posted
2 minutes ago, Jason said:

Thanks for the replies. I still haven't found a solution, but it looks like it may be a bug in Blesta (per blazedd's link).
Thanks again,
--Jason

Have you tried the email template I pointed above since that works for us. Unless your using a API.

  • 0
Posted

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

  • 0
Posted
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.

  • 0
Posted
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!!!!!

  • 0
Posted
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

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...