Fetch the number part of the variable $amount

  • Posts: 107
  • Thank you received: 1
11 years 10 months ago #83592

Hi there,

This is the code I used to fetch the customer's expense:

$currencyClass = hikashop_get('class.currency');
$amount = $currencyClass->format($order->order_full_price,$order->order_currency_id);

But the variable "$amount" is not a pure number. How can I get the pure number only?

Thank you so much. :)

Please Log in or Create an account to join the conversation.

  • Posts: 26152
  • Thank you received: 4027
  • MODERATOR
11 years 10 months ago #83697

Hi,

"$order->order_full_price" contains the price.
"$order->order_currency_id" contains the currency.

$currencyClass->format( $amount, $currency_id ) would give you the human readable amount.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

Time to create page: 0.051 seconds
Powered by Kunena Forum