Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
4133
Missing functionality for value rounding and max input length
posted

Hi,

We started development with Infragistics IgniteUI v14.x and are now on v15.2 and we are no longer seeing some functionality previously present in v14 for igCurrencyEditor.

In past versions of the library, igCurrencyEditor would round values to the maxDecimal length and would not allow users to input more than maxDecimals decimal value.
For example, in v14.x, if we set maxDecimals = 5, input was limited to that many decimals (ex. x.xxxxx) and would not allow an input of 0.123456789, but programmatically setting the value by calling $element.igCurrencyEditor("value", 0.12345999) would round the value to 0.12346.

We are no longer seeing this in 15.2.  Instead, the igCurrencyEditor allows input of any length and simply truncates the value to 0.12345, without rounding.

Was the removal of these features intentional?  If so, what was the reasoning behind it?
Is there any plan to add this functionality back into the editor?
Or, is there a workaround, so we can return to the past functionality?

Thank you.

 

Parents
  • 16310
    Offline posted

    Hi,

    Thank you for posting in the Infragistics community !

    First, let me know that with 15.2 release all Ignite UI editors  have been re-architected to optimize their usability. Thus the behavior of the maxDecimals property was changed as per your observations show. This change is by design and is the expected behavior of the new editors suite. If you want to keep the other behavior , you can achieve this using the following workaround, which rounds the value in the valueChanging event:

    $("#federalTax").igCurrencyEditor({
     listItems: listValues,
     maxDecimals: 4,
     value: 600,
     valueChanging: function (evt, ui) {
        var pos = ui.owner.options.maxDecimals;
        num = parseFloat(ui.editorInput.val());
        ui.newValue = Math.round(num * Math.pow(10,pos)) / Math.pow(10,pos);
        ui.owner.value(ui.newValue);
     }
    });

    Please let me know if you have further questions on the matter, I will be glad to help.

Reply Children