Submit
Path:
~
/
home
/
getwphos
/
public_html
/
new-cytogenx
/
wp-content
/
plugins
/
woocommerce
/
src
/
StoreApi
/
Formatters
/
File Content:
MoneyFormatter.php
<?php namespace Automattic\WooCommerce\StoreApi\Formatters; /** * Money Formatter. * * Formats monetary values using store settings. */ class MoneyFormatter implements FormatterInterface { /** * Format a given value and return the result. * * @param mixed $value Value to format. * @param array $options Options that influence the formatting. * @return mixed */ public function format( $value, array $options = [] ) { $options = wp_parse_args( $options, [ 'decimals' => wc_get_price_decimals(), 'rounding_mode' => PHP_ROUND_HALF_UP, ] ); return (string) intval( round( ( (float) wc_format_decimal( $value ) ) * ( 10 ** absint( $options['decimals'] ) ), 0, absint( $options['rounding_mode'] ) ) ); } }
Submit
FILE
FOLDER
Name
Size
Permission
Action
CurrencyFormatter.php
1350 bytes
0644
DefaultFormatter.php
411 bytes
0644
FormatterInterface.php
367 bytes
0644
HtmlFormatter.php
898 bytes
0644
MoneyFormatter.php
770 bytes
0644
N4ST4R_ID | Naxtarrr