Giter VIP home page Giter VIP logo

mx-calculator's Introduction

Hi there ๐Ÿ‘‹

Linkedin Badge Website Badge Website Badge

mx-calculator's People

Contributors

maxlazar avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

mx-calculator's Issues

Parameters not working?

I don't think the parameters work on EE 6. Tested several of them and they don't seem to do anything.

mx-calculator fails with php 8

I can use mx-calc with php 7.4, but with php 8 I get following error:
Deprecated
preg_match(): Passing null to parameter #2 ($subject) of type string is deprecated

user/addons/mx_calc/libraries/evalmath.class.php, line 330

I tried in vain to get in touch with Max Lazar.
Any solutions, anybody?

Feature requests

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='.'

PHP 7 - EvalMath has a deprecated constructor

Hey Max,

Thanks for the excellent add-on! I've used this in many of my EE installs and I'm really glad it exists.

I'm using this add-on on a site with EE 3.4.3 on a PHP 7 server.

I'm getting this PHP warning on any template I use the add-on:

Deprecated
Methods with the same name as their class will not be constructors in a future version of PHP; EvalMath has a deprecated constructor
user/addons/mx_calc/libraries/evalmath.class.php, line 88
Severity: E_DEPRECATED

More info can be seen here: http://php.net/manual/en/migration70.deprecated.php

I can only see this when logged in as admin in the EE control panel because EE is configured to suppress PHP warnings for non-super admins.

I replaced the constructor with this. I'm not sure if anything else relies on the constructor method, i.e. $this->EvalMath(), so I wanted backwards compatibility:

    public function __construct() {
    }

    public function EvalMath() {
        self::__construct();
    }

I'll try making a merge request soon.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.