Different kinds of doubles in vb.net?
Posted
by Jonathan
on Stack Overflow
See other posts from Stack Overflow
or by Jonathan
Published on 2010-03-21T22:25:15Z
Indexed on
2010/03/21
22:31 UTC
Read the original article
Hit count: 288
Hey all-
I'm using QBFC to generate invoices in a Quickbooks integrating app. I'm getting an exception thrown for lineItem.Amount.SetValue(val as Double) when I try to enter a programmatically generated double.
The following does not work:
lineItem = invoice.ORInvoiceLineAddList.Append.InvoiceLineAdd
Dim amount as Double
amount = summary.dailySold * summary.dailyRate
loggingTxtBox.AppendText("Amount is " & amount & vbNewLine)
lineItem.Amount.SetValue(amount)
The exception I receive is System.Runtime.InteropServices.COMException (0x80040305): Invalid Amount format. at Interop.QBFC8.IQBAmountType.SetValue(Double val)
The following works:
lineItem.Amount.SetValue(20.3)
Any suggestions? Is .NET interpretting a hard-coded double differently than a programmatically calculated one?
Thanks- Jonathan
© Stack Overflow or respective owner