Remove trailing 0's in a 5 decimal place priceShorter Decimal PriceNeed to check if a product has a tier pricePrice Display Decimal Formatting ProblemsRemove trailing zerosMagento 2 : How to remove decimal points from the priceMagento 2: How to remove price decimalRemove .00 decimal from priceFormat price decimal pointshow to remove decimal value from product price Magento 2?How to remove decimal points from price in Magento 2?
Adding empty element to declared container without declaring type of element
Teaching indefinite integrals that require special-casing
How to deal with or prevent idle in the test team?
I2C signal and power over long range (10meter cable)
Is there enough fresh water in the world to eradicate the drinking water crisis?
Can the electrostatic force be infinite in magnitude?
Latex for-and in equation
Could solar power be utilized and substitute coal in the 19th century?
Perfect riffle shuffles
How to be able to process a large JSON response?
Can a controlled ghast be a leader of a pack of ghouls?
Partial sums of primes
Blender - show edges angles “direction”
Is there a word to describe the feeling of being transfixed out of horror?
How can I successfully establish a nationwide combat training program for a large country?
How to deal with loss of decision making power over a change?
Modern Day Chaucer
Are Warlocks Arcane or Divine?
Installing PowerShell on 32-bit Kali OS fails
Left multiplication is homeomorphism of topological groups
What is the opposite of 'gravitas'?
Can a Bard use an arcane focus?
What should I use for Mishna study?
Freedom of speech and where it applies
Remove trailing 0's in a 5 decimal place price
Shorter Decimal PriceNeed to check if a product has a tier pricePrice Display Decimal Formatting ProblemsRemove trailing zerosMagento 2 : How to remove decimal points from the priceMagento 2: How to remove price decimalRemove .00 decimal from priceFormat price decimal pointshow to remove decimal value from product price Magento 2?How to remove decimal points from price in Magento 2?
I have a site where the currency has been set to 5 decimal places because they price small items individually, such as £0.00023
but some products are more, such as £1.45, but the price is being displayed to the user as £1.45000 - how can I strip the last 0's off but only to 2 decimal places - so if a price is £1.00, it still leaves at least 2 0's.
In the price.phtml, the following line displays price, but I need to somehow strip the 0's..
<?php echo $_coreHelper->formatPrice($_finalPrice, false) ?>
magento-1.9 price
bumped to the homepage by Community♦ 7 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
add a comment |
I have a site where the currency has been set to 5 decimal places because they price small items individually, such as £0.00023
but some products are more, such as £1.45, but the price is being displayed to the user as £1.45000 - how can I strip the last 0's off but only to 2 decimal places - so if a price is £1.00, it still leaves at least 2 0's.
In the price.phtml, the following line displays price, but I need to somehow strip the 0's..
<?php echo $_coreHelper->formatPrice($_finalPrice, false) ?>
magento-1.9 price
bumped to the homepage by Community♦ 7 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
add a comment |
I have a site where the currency has been set to 5 decimal places because they price small items individually, such as £0.00023
but some products are more, such as £1.45, but the price is being displayed to the user as £1.45000 - how can I strip the last 0's off but only to 2 decimal places - so if a price is £1.00, it still leaves at least 2 0's.
In the price.phtml, the following line displays price, but I need to somehow strip the 0's..
<?php echo $_coreHelper->formatPrice($_finalPrice, false) ?>
magento-1.9 price
I have a site where the currency has been set to 5 decimal places because they price small items individually, such as £0.00023
but some products are more, such as £1.45, but the price is being displayed to the user as £1.45000 - how can I strip the last 0's off but only to 2 decimal places - so if a price is £1.00, it still leaves at least 2 0's.
In the price.phtml, the following line displays price, but I need to somehow strip the 0's..
<?php echo $_coreHelper->formatPrice($_finalPrice, false) ?>
magento-1.9 price
magento-1.9 price
asked Jan 8 '16 at 10:51
MikeMike
1
1
bumped to the homepage by Community♦ 7 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
bumped to the homepage by Community♦ 7 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
Taken from this answer
https://stackoverflow.com/questions/6730180/format-price-in-the-current-locale-and-currency
I always use the following to format price
$formattedPrice = Mage::helper('core')->currency($finalPrice, true, false);
Thanks bob but this still shows the price with 5 decimals, is there a way I can strip off all the trailing 0's except the 2 after the decimal point, so £0.50000 becomes £0.50 ??
– Mike
Jan 8 '16 at 11:32
what is being stored to $_finalPrice, also are you doing this within price template file or outside of price template?
– Bobadevv
Jan 8 '16 at 11:37
the actual value of $_finalPrice is 0.5 and I'm doing this from within the price.phtml albeit in a custom theme so not amending any core templates
– Mike
Jan 8 '16 at 11:41
what about if you try $formattedPrice = Mage::helper('core')->currency($finalPrice, false, false);
– Bobadevv
Jan 8 '16 at 11:44
ah oh wait might of confused things, the line of code I pasted above is slightly wrong, its $_regularPrice not $_finalPrice If I use your query in message above, $_regularPrice still returns 0.5
– Mike
Jan 8 '16 at 12:07
|
show 2 more comments
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "479"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f96443%2fremove-trailing-0s-in-a-5-decimal-place-price%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Taken from this answer
https://stackoverflow.com/questions/6730180/format-price-in-the-current-locale-and-currency
I always use the following to format price
$formattedPrice = Mage::helper('core')->currency($finalPrice, true, false);
Thanks bob but this still shows the price with 5 decimals, is there a way I can strip off all the trailing 0's except the 2 after the decimal point, so £0.50000 becomes £0.50 ??
– Mike
Jan 8 '16 at 11:32
what is being stored to $_finalPrice, also are you doing this within price template file or outside of price template?
– Bobadevv
Jan 8 '16 at 11:37
the actual value of $_finalPrice is 0.5 and I'm doing this from within the price.phtml albeit in a custom theme so not amending any core templates
– Mike
Jan 8 '16 at 11:41
what about if you try $formattedPrice = Mage::helper('core')->currency($finalPrice, false, false);
– Bobadevv
Jan 8 '16 at 11:44
ah oh wait might of confused things, the line of code I pasted above is slightly wrong, its $_regularPrice not $_finalPrice If I use your query in message above, $_regularPrice still returns 0.5
– Mike
Jan 8 '16 at 12:07
|
show 2 more comments
Taken from this answer
https://stackoverflow.com/questions/6730180/format-price-in-the-current-locale-and-currency
I always use the following to format price
$formattedPrice = Mage::helper('core')->currency($finalPrice, true, false);
Thanks bob but this still shows the price with 5 decimals, is there a way I can strip off all the trailing 0's except the 2 after the decimal point, so £0.50000 becomes £0.50 ??
– Mike
Jan 8 '16 at 11:32
what is being stored to $_finalPrice, also are you doing this within price template file or outside of price template?
– Bobadevv
Jan 8 '16 at 11:37
the actual value of $_finalPrice is 0.5 and I'm doing this from within the price.phtml albeit in a custom theme so not amending any core templates
– Mike
Jan 8 '16 at 11:41
what about if you try $formattedPrice = Mage::helper('core')->currency($finalPrice, false, false);
– Bobadevv
Jan 8 '16 at 11:44
ah oh wait might of confused things, the line of code I pasted above is slightly wrong, its $_regularPrice not $_finalPrice If I use your query in message above, $_regularPrice still returns 0.5
– Mike
Jan 8 '16 at 12:07
|
show 2 more comments
Taken from this answer
https://stackoverflow.com/questions/6730180/format-price-in-the-current-locale-and-currency
I always use the following to format price
$formattedPrice = Mage::helper('core')->currency($finalPrice, true, false);
Taken from this answer
https://stackoverflow.com/questions/6730180/format-price-in-the-current-locale-and-currency
I always use the following to format price
$formattedPrice = Mage::helper('core')->currency($finalPrice, true, false);
edited May 23 '17 at 12:37
Community♦
1
1
answered Jan 8 '16 at 11:21
BobadevvBobadevv
1,050413
1,050413
Thanks bob but this still shows the price with 5 decimals, is there a way I can strip off all the trailing 0's except the 2 after the decimal point, so £0.50000 becomes £0.50 ??
– Mike
Jan 8 '16 at 11:32
what is being stored to $_finalPrice, also are you doing this within price template file or outside of price template?
– Bobadevv
Jan 8 '16 at 11:37
the actual value of $_finalPrice is 0.5 and I'm doing this from within the price.phtml albeit in a custom theme so not amending any core templates
– Mike
Jan 8 '16 at 11:41
what about if you try $formattedPrice = Mage::helper('core')->currency($finalPrice, false, false);
– Bobadevv
Jan 8 '16 at 11:44
ah oh wait might of confused things, the line of code I pasted above is slightly wrong, its $_regularPrice not $_finalPrice If I use your query in message above, $_regularPrice still returns 0.5
– Mike
Jan 8 '16 at 12:07
|
show 2 more comments
Thanks bob but this still shows the price with 5 decimals, is there a way I can strip off all the trailing 0's except the 2 after the decimal point, so £0.50000 becomes £0.50 ??
– Mike
Jan 8 '16 at 11:32
what is being stored to $_finalPrice, also are you doing this within price template file or outside of price template?
– Bobadevv
Jan 8 '16 at 11:37
the actual value of $_finalPrice is 0.5 and I'm doing this from within the price.phtml albeit in a custom theme so not amending any core templates
– Mike
Jan 8 '16 at 11:41
what about if you try $formattedPrice = Mage::helper('core')->currency($finalPrice, false, false);
– Bobadevv
Jan 8 '16 at 11:44
ah oh wait might of confused things, the line of code I pasted above is slightly wrong, its $_regularPrice not $_finalPrice If I use your query in message above, $_regularPrice still returns 0.5
– Mike
Jan 8 '16 at 12:07
Thanks bob but this still shows the price with 5 decimals, is there a way I can strip off all the trailing 0's except the 2 after the decimal point, so £0.50000 becomes £0.50 ??
– Mike
Jan 8 '16 at 11:32
Thanks bob but this still shows the price with 5 decimals, is there a way I can strip off all the trailing 0's except the 2 after the decimal point, so £0.50000 becomes £0.50 ??
– Mike
Jan 8 '16 at 11:32
what is being stored to $_finalPrice, also are you doing this within price template file or outside of price template?
– Bobadevv
Jan 8 '16 at 11:37
what is being stored to $_finalPrice, also are you doing this within price template file or outside of price template?
– Bobadevv
Jan 8 '16 at 11:37
the actual value of $_finalPrice is 0.5 and I'm doing this from within the price.phtml albeit in a custom theme so not amending any core templates
– Mike
Jan 8 '16 at 11:41
the actual value of $_finalPrice is 0.5 and I'm doing this from within the price.phtml albeit in a custom theme so not amending any core templates
– Mike
Jan 8 '16 at 11:41
what about if you try $formattedPrice = Mage::helper('core')->currency($finalPrice, false, false);
– Bobadevv
Jan 8 '16 at 11:44
what about if you try $formattedPrice = Mage::helper('core')->currency($finalPrice, false, false);
– Bobadevv
Jan 8 '16 at 11:44
ah oh wait might of confused things, the line of code I pasted above is slightly wrong, its $_regularPrice not $_finalPrice If I use your query in message above, $_regularPrice still returns 0.5
– Mike
Jan 8 '16 at 12:07
ah oh wait might of confused things, the line of code I pasted above is slightly wrong, its $_regularPrice not $_finalPrice If I use your query in message above, $_regularPrice still returns 0.5
– Mike
Jan 8 '16 at 12:07
|
show 2 more comments
Thanks for contributing an answer to Magento Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f96443%2fremove-trailing-0s-in-a-5-decimal-place-price%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown