remove decimal value from price
Forum rules
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
- VirtualSpy
- Advanced
- Posts: 122
- Joined: 05 Jul 2022, 07:55
remove decimal value from price
laravel version 9.48.0 , Aimeos version 2022.10.4 and PHP version 8.1.3 (Win)
I changed the "value" column type from decimal to int from table mshop_price & mshop_index_price but the price is still showing in decimal. why?
I also checked this template using die dump (dd) here getting decimal value https://github.com/aimeos/ai-client-htm ... 70C3-L77C1
on function getValue() return the value using function formatNumber() . and precision value is getting 2 , from here
now using config anyone can change the precision value
And sorry Aimeos before getting a response from you I found the solution so, I edited my post again and again.
I changed the "value" column type from decimal to int from table mshop_price & mshop_index_price but the price is still showing in decimal. why?
I also checked this template using die dump (dd) here getting decimal value https://github.com/aimeos/ai-client-htm ... 70C3-L77C1
on function getValue() return the value using function formatNumber() . and precision value
Code: Select all
$priceItem->getPrecision()
Code: Select all
https://github.com/aimeos/aimeos-core/blob/master/src/MShop/Price/Manager/Standard.php#LL330C3-L331C1
And sorry Aimeos before getting a response from you I found the solution so, I edited my post again and again.
Re: remove decimal value from price
Number formatting is done in the Number view helper:
https://github.com/aimeos/aimeos-base/b ... hp#L46-L57
Set the number of decimals with that config option:
https://github.com/aimeos/aimeos-base/b ... hp#L46-L57
Set the number of decimals with that config option:
Code: Select all
mshop/price/precision = 0
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star