Skip to content

Instantly share code, notes, and snippets.

@treetop1500
Created September 16, 2016 16:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save treetop1500/3587a91a6ba036be5252cd11d3dace1d to your computer and use it in GitHub Desktop.
Save treetop1500/3587a91a6ba036be5252cd11d3dace1d to your computer and use it in GitHub Desktop.
Twig Extensions:twig_extension_price.php
/**
* @param $amt
* @return string
* strips out non-numeric characters and adds the +1 country code.
*/
function price($amt)
{
return '<span class="dollar-sign">$</span>'.number_format($amt,2);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment