Title: Calculate Values with Shortcodes
Author: bhagwad
Published: <strong>Mayo 25, 2018</strong>
Last modified: Mayo 20, 2020

---

Maghanap ng mga plugin

Ang plugin na ito ay **hindi pa nasusubukan sa pinakabagong 3 major release ng WordPress**.
Maaaring hindi na ito minamantine o sinusuportahan at maaaring may mga isyu sa compatibility
kapag ginamit sa mas bagong bersyon ng WordPress.

![](https://s.w.org/plugins/geopattern-icon/calculate-values-with-shortcodes.svg)

# Calculate Values with Shortcodes

 Ni [bhagwad](https://profiles.wordpress.org/bhagwad/)

[I-download](https://downloads.wordpress.org/plugin/calculate-values-with-shortcodes.zip)

 * [Mga Detalye](https://tl.wordpress.org/plugins/calculate-values-with-shortcodes/#description)
 * [Mga Review](https://tl.wordpress.org/plugins/calculate-values-with-shortcodes/#reviews)
 *  [Pag-install](https://tl.wordpress.org/plugins/calculate-values-with-shortcodes/#installation)
 * [Development](https://tl.wordpress.org/plugins/calculate-values-with-shortcodes/#developers)

 [Suporta](https://wordpress.org/support/plugin/calculate-values-with-shortcodes/)

## Deskripsyon

Have you ever wanted to calculate some values dynamically to display in your posts?
Let’s say you have some shortcodes that retrieve values in real time from the database.
Now you want to perform some calculations on those shortcodes and display the results
in your posts or pages. This plugin allows you to use a simple [calculate] shortcode
with the expression inside to display these values in real time!

So an expression like [calculate]2+3*4[/calculate] will return the value “14”. Now
just replace any numeric value with a shortcode that returns a number and you’re
set.

### Attributes

You can use the “dec” attribute to specify the number of decimal digits you want
to round the result up to. The default is “0”. Meaning that by default, all results
will be rounded to an integer.

For international number formatting, you can use the “int” attribute to specify 
a locale. For example, int=”fr_FR” will format the numbers according to the french
locale!

See screenshots for illustrations.

For example, you can use this to display values in a table that are constantly changing.
Or refer to dynamic prices multiplied by some value. The possibilities are endless.

You can see a real world example of this plugin at work [here:](https://www.wp-tweaks.com/how-to-calculate-values-in-wordpress-posts-and-pages/)

The best part is, it doesn’t use dangerous functions like “eval” to work – which
means all authors can use it safely. There’s no danger of it breaking your site.

## Mga Screenshot

 * [[
 * Basic Shortcode Usage in Editor
 * [[
 * Calculated value in the post
 * [[
 * Shortcode usage with shortcodes inside

## Pag-install

 1. You can install the plugin from WordPress’s plugin repository.
 2. Just click “Activate” to enable the shortcode.
 3. Or download the zipped file
 4. Then go to Plugins -> Add New
 5. Click “Upload Plugin” at the top of the screen
 6. Use “Choose File” , select the zip file you just downloaded, and click “Install
    Now”
 7. On the next screen, click “Activate”

## FAQ

 1. What math expressions can I use with this plugin?
     This plugin supports all expressions
    allowed by EvalMath. You can see the documentation on this git page: https://github.
    com/dbojdo/eval-math

## Mga Review

![](https://secure.gravatar.com/avatar/ed1f95e0717655dd585b1762a61b484b9991dd431ec0cf37125187dd169e3f77?
s=60&d=retro&r=g)

### 󠀁[Great little tool for inline calculations](https://wordpress.org/support/topic/great-little-tool-for-inline-calculations/)󠁿

 [cheekycreative](https://profiles.wordpress.org/cheekycreative/) Enero 21, 2022

Used this for a few years now and was just perfect for a few situations where I 
could do calculations to variables within headlines, text and other drag and drop
elements. I could pull in dynamic woo product prices and calculate it with another
variable fees within custom store pages. Non computer person could just update the
woo product base price and everything would display correctly everywhere. Starting
having a few issues in the last year, think about the same time I upgraded to php8.
Issue was it was dropping the last digit in the decimals on rounding if it ended
in 0 regardless of the dec= attribute setting. ie) 3.99 displays fine but 3.90 would
come out as 3.9. I came up with a fix for it though to force the second decimal.
Will post it in the support discussion.

![](https://secure.gravatar.com/avatar/33ad53a58ffd5bc1ee2657ff863153032c6d16b670eaa930e3a550e4b256168b?
s=60&d=retro&r=g)

### 󠀁[Thank You!](https://wordpress.org/support/topic/thank-you-2615/)󠁿

 [phomar](https://profiles.wordpress.org/phomar/) Disyembre 2, 2020

Thank You so much!

![](https://secure.gravatar.com/avatar/127b005f8a1bda0b22f1b00322a6a7a8c55361b827933c04df954ca516ecd12a?
s=60&d=retro&r=g)

### 󠀁[Fantastic plugin!!](https://wordpress.org/support/topic/fantastic-plugin-1408/)󠁿

 [ukbestrong](https://profiles.wordpress.org/ukbestrong/) Agosto 26, 2020

Great support, works flawlessly and really helped us out with some complex calculations!

![](https://secure.gravatar.com/avatar/5a809fb05ec8fc251ec40ff1e88193b30050b8e456a4e34aa9d037f6d4ab992a?
s=60&d=retro&r=g)

### 󠀁[The plugin is not compatible with Storefront + WooCommerce.](https://wordpress.org/support/topic/the-plugin-is-not-compatible-with-storefront-woocommerce/)󠁿

 [pescianschi](https://profiles.wordpress.org/pescianschi/) Nobyembre 5, 2019

This plugin kills the normal look in the Storefront theme + WooCommerce. Replacing“
<?” with “<?php” evalmath.class.php solved the problem.

![](https://secure.gravatar.com/avatar/fa6acbc931bc6c104be186a14f8796fb33e9c844f29b4eb55bf7cdb0a1ac9c31?
s=60&d=retro&r=g)

### 󠀁[Great Plugin and Best Support](https://wordpress.org/support/topic/great-plugin-and-best-support-12/)󠁿

 [Forson](https://profiles.wordpress.org/forson/) Mayo 16, 2019

This plugin does what it says. It enables you to calculate numeric values generated
by shortcodes or numbers within the site. Support is fantastic. When there was a
problem with hidden characters the developer pushed an upgrade out solving the problem
in less than a day!

![](https://secure.gravatar.com/avatar/155e59e96cb405b017b64f8942c246b01a622d7631f73fe16093f0b6148a96ed?
s=60&d=retro&r=g)

### 󠀁[Very easy to use](https://wordpress.org/support/topic/very-easy-to-use-391/)󠁿

 [searchngp](https://profiles.wordpress.org/searchngp/) Nobyembre 7, 2018

It’s very easy to use and works as described

 [ Basahin lahat ng 9 na review ](https://wordpress.org/support/plugin/calculate-values-with-shortcodes/reviews/)

## Mga Contributor at Developer

Ang “Calculate Values with Shortcodes” ay open source software. Ang mga sumusunod
na tao ay nag-ambag sa plugin na ito.

Mga Contributor

 *   [ bhagwad ](https://profiles.wordpress.org/bhagwad/)

[Isalin ang “Calculate Values with Shortcodes” sa iyong wika.](https://translate.wordpress.org/projects/wp-plugins/calculate-values-with-shortcodes)

### Interesado sa development?

[Tingnan ang code](https://plugins.trac.wordpress.org/browser/calculate-values-with-shortcodes/),
i-check ang [SVN repository](https://plugins.svn.wordpress.org/calculate-values-with-shortcodes/),
o mag-subscribe sa [development log](https://plugins.trac.wordpress.org/log/calculate-values-with-shortcodes/)
sa pamamagitan ng [RSS](https://plugins.trac.wordpress.org/log/calculate-values-with-shortcodes/?limit=100&mode=stop_on_copy&format=rss).

## Changelog

#### 2.3

Changed <? to <?php in evalmath.class.php
 Removed the deprecated “money_format”
function and replaced it with NumberFormatter instead

#### 2.2

Strip out HTML from any inside shortcodes

#### 2.1.1

Fixed a potential deprecation error: “Methods with the same name as their class 
will not be constructors in a future version of PHP”

Thanks to Kristina for pointing it out!

#### 2.1

Strip HTML from inside shortcodes

Added a new optional “int” attribute which will format the output in a local currency.
So for example, [calculate int=”fr_FR”]15.00[/calculate] will return 15,00

Fixed a potential deprecation error: “Methods with the same name as their class 
will not be constructors in a future version of PHP”

## Meta

 *  Bersyon **2.3**
 *  Huling na-update **6 taon ang nakalipas**
 *  Mga aktibong installation **200+**
 *  Bersyon ng WordPress ** 4.0 o mas bago **
 *  Sinubukan hanggang **5.4.19**
 *  Bersyon ng PHP ** 5.2.4 o mas bago **
 *  Wika
 * [English (US)](https://wordpress.org/plugins/calculate-values-with-shortcodes/)
 * Mga Tag
 * [calculated fields](https://tl.wordpress.org/plugins/tags/calculated-fields/)
   [evaluation](https://tl.wordpress.org/plugins/tags/evaluation/)[shortcodes](https://tl.wordpress.org/plugins/tags/shortcodes/)
 *  [Advanced View](https://tl.wordpress.org/plugins/calculate-values-with-shortcodes/advanced/)

## Mga Rating

 4.8 out of 5 stars.

 *  [  8 5-star reviews     ](https://wordpress.org/support/plugin/calculate-values-with-shortcodes/reviews/?filter=5)
 *  [  0 4-star reviews     ](https://wordpress.org/support/plugin/calculate-values-with-shortcodes/reviews/?filter=4)
 *  [  1 3-star review     ](https://wordpress.org/support/plugin/calculate-values-with-shortcodes/reviews/?filter=3)
 *  [  0 2-star reviews     ](https://wordpress.org/support/plugin/calculate-values-with-shortcodes/reviews/?filter=2)
 *  [  0 1-star reviews     ](https://wordpress.org/support/plugin/calculate-values-with-shortcodes/reviews/?filter=1)

[Your review](https://wordpress.org/support/plugin/calculate-values-with-shortcodes/reviews/#new-post)

[Tingnan lahat ng review](https://wordpress.org/support/plugin/calculate-values-with-shortcodes/reviews/)

## Mga Contributor

 *   [ bhagwad ](https://profiles.wordpress.org/bhagwad/)

## Suporta

May gusto kang sabihin? Kailangan ng tulong?

 [Tingnan ang support forum](https://wordpress.org/support/plugin/calculate-values-with-shortcodes/)

## Mag-donate

Gusto mo bang suportahan ang pagpapaunlad ng plugin na ito?

 [ Mag-donate sa plugin na ito ](https://www.wp-tweaks.com)