Hello @meckerlax
At the moment, you’ll need to edit core plugin file stock-quote.php and do couple changes:
#1: find line with comment // Define class based on change.
and add below that line:
$prefix = '';
#2: find line } elseif ( $q_change > 0 ) {
and add below that line:
$prefix = '+';
#3: find line with comment // Text.
and add below that line:
$q_price = number_format( $q_price, 2, ',', '.' );
$q_change = $prefix . number_format( $q_change, 2, ',', '.' );
$q_changep = $prefix . number_format( $q_changep, 2, ',', '.' );
Save file and upload to server. You should get what you ask for. Example screenshot https://goo.gl/r6kMqz
Kind regards,
Aleksandar
Hi Max,
I released version 0.1.6 with implemented options to choose number format and even amount of decimal places. You can try it, if you like.
Cheers,
Aleksandar
Thanks Aleksandar!
It will be great to have it as a shortcode parameter. This way I would display it differently on a multilingual wordpress.
Antoine
Hello @ceer,
Just releassed version 0.1.7 which now have two new shortcode parameters:
* decimals
to override default number of decimal places for values (default from settings page used if no custom set by shortcode). Valid values are: 1
, 2
, 3
and 4
* number_format
to override default number format for values (default from this settings page used if no custom set by shortcode). Valid options are: cd
for 0.000,00; dc
for 0,000.00; sd
for 0 000.00 and sc
for 0 000,00
Cheers,
Aleksandar
Wow great! Thanks a lot @urkekg.