Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature requests #4

Open
klibansky opened this issue Nov 5, 2020 · 1 comment
Open

Feature requests #4

klibansky opened this issue Nov 5, 2020 · 1 comment

Comments

@klibansky
Copy link

I would like to request some features:

  • use variables (template variables, template partials, low variables) & exp:tags (like stash) as number values to do calculations on
    • eg: {exp:mx_calc expression="{grid_field:numbers_column} * {template_variable} + {exp:stash:get:value} / {template_partial}"} where the variables are numeric values
  • support parse='inward' for above example
  • be able to set the number of decimals
    • eg via a parameter: decimals='2'
  • be able to force decimals if round number
    • eg via parameter: force_zeros='yes'
  • set decimals separator: decimal_seperator=','
  • set thousands separator: thousand_seperator='.'
@MaxLazar
Copy link
Owner

  1. is no magic solution here due to EE parsing order. It would be needed still play with tag order templates. But MX Calc v. 3.0.5 now has variables and a late parsing option, which should help to build more flexible solutions. I will do extra R&D for future versions.

  2. It was not documented (my bad), but it was always possible to do a number format

{exp:mx_calc expression='number_format(12123.1, 2)'}
output : 12,123.10

{exp:mx_calc expression='number_format_eu(120993, 2)'}
output: 120 993,00

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants