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

---

Prohledat pluginy

Plugin **nebyl testován na 3 nejnovějších verzích WordPressu.** Nemusí už být tedy
podporován a u novějších verzí WordPressu může mít problémy s kompatibilitou a může
být nestabilní.

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

# Calculate Values with Shortcodes

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

[Stáhnout](https://downloads.wordpress.org/plugin/calculate-values-with-shortcodes.zip)

 * [Podrobnosti](https://cs.wordpress.org/plugins/calculate-values-with-shortcodes/#description)
 * [Hodnocení](https://cs.wordpress.org/plugins/calculate-values-with-shortcodes/#reviews)
 *  [Instalace](https://cs.wordpress.org/plugins/calculate-values-with-shortcodes/#installation)
 * [Vývojáři](https://cs.wordpress.org/plugins/calculate-values-with-shortcodes/#developers)

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

## Popis

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.

## Snímky obrazovky

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

## Instalace

 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“

## Nejčastější dotazy

 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

## Recenze

![](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/) 21. 1. 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/) 2. 12. 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/) 26. 8. 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/) 5. 11. 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/) 16. 5. 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/) 7. 11. 2018

It’s very easy to use and works as described

 [ Přečtěte si všech 9 recenzí ](https://wordpress.org/support/plugin/calculate-values-with-shortcodes/reviews/)

## Autoři

Calculate Values with Shortcodes je otevřený software. Následující lidé přispěli
k vývoji tohoto pluginu.

Spolupracovníci

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

[Přeložte “Calculate Values with Shortcodes” do svého jazyka.](https://translate.wordpress.org/projects/wp-plugins/calculate-values-with-shortcodes)

### Zajímá vás vývoj?

[Prohledejte kód](https://plugins.trac.wordpress.org/browser/calculate-values-with-shortcodes/),
podívejte se do [SVN repozitáře](https://plugins.svn.wordpress.org/calculate-values-with-shortcodes/),
nebo se přihlaste k[ odběru protokolu vývoje](https://plugins.trac.wordpress.org/log/calculate-values-with-shortcodes/)
pomocí [RSS](https://plugins.trac.wordpress.org/log/calculate-values-with-shortcodes/?limit=100&mode=stop_on_copy&format=rss).

## Přehled změn

#### 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

 *  Verze **2.3**
 *  Poslední aktualizace **před 6 roky**
 *  Aktivních instalací **200+**
 *  Verze WordPressu ** 4.0 nebo novější **
 *  Testováno až do WordPressu **5.4.19**
 *  Verze PHP ** 5.2.4 nebo novější **
 *  Jazyk
 * [English (US)](https://wordpress.org/plugins/calculate-values-with-shortcodes/)
 * Štítky
 * [calculated fields](https://cs.wordpress.org/plugins/tags/calculated-fields/)
   [evaluation](https://cs.wordpress.org/plugins/tags/evaluation/)[shortcodes](https://cs.wordpress.org/plugins/tags/shortcodes/)
 *  [Podrobnosti](https://cs.wordpress.org/plugins/calculate-values-with-shortcodes/advanced/)

## Hodnocení

 4.8 z 5 hvězdiček.

 *  [  8 5hvězdičkové hodnocení     ](https://wordpress.org/support/plugin/calculate-values-with-shortcodes/reviews/?filter=5)
 *  [  0 4hvězdičkové hodnocení     ](https://wordpress.org/support/plugin/calculate-values-with-shortcodes/reviews/?filter=4)
 *  [  1 3hvězdičkové hodnocení     ](https://wordpress.org/support/plugin/calculate-values-with-shortcodes/reviews/?filter=3)
 *  [  0 2hvězdičkové hodnocení     ](https://wordpress.org/support/plugin/calculate-values-with-shortcodes/reviews/?filter=2)
 *  [  0 1hvězdičkové hodnocení     ](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)

[Zobrazit všechny recenze](https://wordpress.org/support/plugin/calculate-values-with-shortcodes/reviews/)

## Spolupracovníci

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

## Podpora

Potřebujete pomoc?

 [Fórum podpory](https://wordpress.org/support/plugin/calculate-values-with-shortcodes/)

## Dary

Chtěli byste podpořit vývoj tohoto pluginu?

 [ Přispět na tento plugin ](https://www.wp-tweaks.com)