Title: Raised value via shortcode
Last modified: May 24, 2022

---

# Raised value via shortcode

 *  Resolved [avandelaak](https://wordpress.org/support/users/avandelaak/)
 * (@avandelaak)
 * [4 years ago](https://wordpress.org/support/topic/raised-value-via-shortcode/)
 * Hi, I have used the thermometer to show a dynamic raised value via a Molly form.
   The format of the raised value is incorrect. It should be EUR 7565,00 and is 
   showing 7.57 instead.
 * I adapted the file: therm_shortcode.php with this code from another topic:
 *     ```
       //raised value
       	if ($atts['raised'] == '' && !empty($options['raised_string'])){
       	    $thermProperties['raised'] = $options['raised_string'];
       	}
       	else{
       		if (!is_numeric(str_replace(",", ".", $atts['raised']))) {
       			$shortcode = "[".strval($atts['raised'])."]";
       			$atts['raised'] = do_shortcode( $shortcode);
       		}
       	    $thermProperties['raised'] = str_replace(",","",strval($atts['raised']));
       	}
       ```
   
 * Still the same issue. How can I get the value showed correctly?
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fraised-value-via-shortcode%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Author [rhewlif](https://wordpress.org/support/users/henryp/)
 * (@henryp)
 * [4 years ago](https://wordpress.org/support/topic/raised-value-via-shortcode/#post-15675147)
 * Hi,
    I think the problem is I have not taken into account the use of commas for
   a decimal point when parsing a shortcode, which is adding to the confusion.
 * Since you seem comfortable to change the plugin code, then to fix this quickly
   you can change line 121 in therm_shortcode.php to
    `$thermProperties['raised']
   = str_replace(',', '.', str_replace('.', '', strval($atts['raised'])));`
 * and line 57 in therm_svg.php to:
    `$raisedValue = ($thermProperties['trailing']
   == 'true') ? number_format($raisedTotal,$decimals,',',$thermProperties['sep']).
   $currency : $currency.number_format($raisedTotal,$decimals,',',$thermProperties['
   sep']);`
 * I am also presuming on the settings page or in the thermometer shortcode you 
   also have set the parameters sep=. and decimals=2.
 * I’ll prioritise this fix more permanently for the next plugin update.
    Cheers
 *  Thread Starter [avandelaak](https://wordpress.org/support/users/avandelaak/)
 * (@avandelaak)
 * [4 years ago](https://wordpress.org/support/topic/raised-value-via-shortcode/#post-15676388)
 * This works! Many thanks!
 *  Plugin Author [rhewlif](https://wordpress.org/support/users/henryp/)
 * (@henryp)
 * [4 years ago](https://wordpress.org/support/topic/raised-value-via-shortcode/#post-15687937)
 * I’ve just pushed version 2.1.1 which should help with this issue. Just use the
   new parameter ‘decsep’

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Raised value via shortcode’ is closed to new replies.

 * ![](https://ps.w.org/donation-thermometer/assets/icon-256x256.png?rev=3197594)
 * [Donation Thermometer](https://wordpress.org/plugins/donation-thermometer/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/donation-thermometer/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/donation-thermometer/)
 * [Active Topics](https://wordpress.org/support/plugin/donation-thermometer/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/donation-thermometer/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/donation-thermometer/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [rhewlif](https://wordpress.org/support/users/henryp/)
 * Last activity: [4 years ago](https://wordpress.org/support/topic/raised-value-via-shortcode/#post-15687937)
 * Status: resolved