Page 1 of 1

Sales Order Decimal issue rounding

PostPosted: Mon Aug 06, 2018 3:45 pm
by Riyaz
Hi Mike

A strange issue, the value which gets assigned is 5.6 but it appears as 5.5999 on the sales order lines in the ExtPrice field, below is the code used, pls advise

decimal dPrice = (decimal) nondel.Price;

System.Windows.Forms.MessageBox.Show(dPrice.ToString());

salesorder.SalesOrderLines.AddInventoryItem(nondel.PartNo, JiwaFinancials.Jiwa.JiwaSales.SalesOrder.SalesOrderLineCollection.SalesOrderLineInventorySeedTypes.e_SalesOrderLinePartNo, ref KeyToGetBackHere);
salesorder.SalesOrderLines[(KeyToGetBackHere as string)].DiscountedPrice = dPrice;

Re: Sales Order Decimal issue rounding

PostPosted: Mon Aug 06, 2018 3:57 pm
by Mike.Sheen
What type and what value is nondel.Price?

What version of Jiwa?

Re: Sales Order Decimal issue rounding

PostPosted: Mon Aug 06, 2018 4:57 pm
by Riyaz
its jiwa 7.1.0

and nondel.Price is a double

Re: Sales Order Decimal issue rounding  Topic is solved

PostPosted: Tue Aug 07, 2018 10:40 am
by Mike.Sheen
Hi Riyaz,

Can you test with the attached plugin?

It adds a button to the ribbon of the sales order form, "Test" - when click it adds part "1170" and sets the discounted price to be 5.6.

It seems to work fine for me - you might want to test first on a Jiwa demo database which has part "1170" in it - then on your own database and at that point you might want to change the part number used.

Mike