in

Serious Bug on WebNumericEdit

Last post 05-09-2008 9:13 AM by C1_DmitriM. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 05-08-2008 11:02 AM

    Serious Bug on WebNumericEdit

    hi support,

    try to insert in a new webform this simple code:

    <c1:C1WebNumericEdit ID="Qty" OnClientTextChanged="TotalAmountObj.set_Value(QtyObj.get_Value()*UnitPriceObj.get_Value());" runat="server" />

    <c1:C1WebCurrencyEdit ID="UnitPrice" OnClientTextChanged="TotalAmountObj.set_Value(QtyObj.get_Value()*UnitPriceObj.get_Value());" runat="server" />

    <c1:C1WebCurrencyEdit ID="TotalAmount" runat="server" />

    if you type in Qty control 960 and in UnitPrice control 0.57 result is 547.19 and is wrong. try using window calc and get 547.20

    How can i solve this very big problem?

    Thanks

    Filed under:
  • 05-09-2008 8:28 AM In reply to

    Re: Serious Bug on WebNumericEdit

    I am able to replicate the issue. I can see the difference of .01 for two decimal places. However, if I multiply 1000* 0.57, then it returns the value correct 570.00.
    Also, its working fine on the Server side code.

    Me.C1WebCurrencyEdit2.Value = Me.C1WebNumericEdit1.Value * Me.C1WebCurrencyEdit1.Value

    Please send this to support@componentone.com.
     
    Regards,
    Patrick
    <palegra> wrote in message news:204677@10.0.1.98...

    hi support,

    try to insert in a new webform this simple code:

    <c1:C1WebNumericEdit ID="Qty" OnClientTextChanged="TotalAmountObj.set_Value(QtyObj.get_Value()*UnitPriceObj.get_Value());" runat="server" />

    <c1:C1WebCurrencyEdit ID="UnitPrice" OnClientTextChanged="TotalAmountObj.set_Value(QtyObj.get_Value()*UnitPriceObj.get_Value());" runat="server" />

    <c1:C1WebCurrencyEdit ID="TotalAmount" runat="server" />

    if you type in Qty control 960 and in UnitPrice control 0.57 result is 547.19 and is wrong. try using window calc and get 547.20

    How can i solve this very big problem?

    Thanks



    http://helpcentral.componentone.com/cs/forums/p/75195/204677.aspx#204677

  • 05-09-2008 9:13 AM In reply to

    Re: Serious Bug on WebNumericEdit

    Hi,

    Following is solution for problem:

       var resultVal = 960 * 0.57;
      // Round 547.1999999(9):
      resultVal = Math.round(resultVal * 100) / 100;
      alert("0.57 * 547.19 = " + resultVal );

    Best regards, Dmitri. 

Page 1 of 1 (3 items)
Contact ComponentOne: 1.800.858.2739 ©1987-2007 ComponentOne LLC All Rights Reserved.