Gotchya. I found these on another thread. This might help in your conversions. I was running into major issues converting between doubles. In this app I happen to be using SQLite which doesn’t have a Currency Datatype so I’m using Integer (SQLite is 64 bit integers by default) and convert them to Currency.
[code]Function ToCurrency(extends iValue as Int64) As Currency
dim mb as new MemoryBlock(8)
mb.Int64Value(0) = iValue
return mb.CurrencyValue(0)
End Function
[/code]
[code]Function ToInt64(extends cValue as Currency) As Int64
dim mb as new MemoryBlock(8)
mb.CurrencyValue(0) = cValue
return mb.Int64Value(0)
End Function[/code]
Function ToString(extends cValue as Currency) As String
return Format(cValue, "#,##0.00")
End Function