Platforms to show: All Mac Windows Linux Cross-Platform

Back to SQLNumericMBS class.

SQLNumericMBS.NumericWithCurrency(value as Currency) as SQLNumericMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method SQL MBS SQL Plugin 14.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Creates a new numeric value object with given currency value.
Example
// test code for currency
dim c1 as Currency = 12345678.
dim c2 as Currency = 1234567.8
dim c3 as Currency = 123456.78
dim c4 as Currency = 12345.678
dim c5 as Currency = 1234.5678
dim c6 as Currency = 123.45678

dim n1 as SQLNumericMBS = SQLNumericMBS.NumericWithCurrency(c1)
dim n2 as SQLNumericMBS = SQLNumericMBS.NumericWithCurrency(c2)
dim n3 as SQLNumericMBS = SQLNumericMBS.NumericWithCurrency(c3)
dim n4 as SQLNumericMBS = SQLNumericMBS.NumericWithCurrency(c4)
dim n5 as SQLNumericMBS = SQLNumericMBS.NumericWithCurrency(c5)
dim n6 as SQLNumericMBS = SQLNumericMBS.NumericWithCurrency(c6)

dim s1 as string = n1.StringValue
dim s2 as string = n2.StringValue
dim s3 as string = n3.StringValue
dim s4 as string = n4.StringValue
dim s5 as string = n5.StringValue
dim s6 as string = n6.StringValue

dim d1 as Double = n1.DoubleValue
dim d2 as Double = n2.DoubleValue
dim d3 as Double = n3.DoubleValue
dim d4 as Double = n4.DoubleValue
dim d5 as Double = n5.DoubleValue
dim d6 as Double = n6.DoubleValue

dim x1 as Currency = n1.CurrencyValue
dim x2 as Currency = n2.CurrencyValue
dim x3 as Currency = n3.CurrencyValue
dim x4 as Currency = n4.CurrencyValue
dim x5 as Currency = n5.CurrencyValue
dim x6 as Currency = n6.CurrencyValue

// check for errors
if x1<>c1 then break
if x2<>c2 then break
if x3<>c3 then break
if x4<>c4 then break
if x5<>c5 then break
if x6<>c6 then break

if x1*10000 <> round(d1 * 10000) then Break
if x2*10000 <> round(d2 * 10000) then Break
if x3*10000 <> round(d3 * 10000) then Break
if x4*10000 <> round(d4 * 10000) then Break
if x5*10000 <> round(d5 * 10000) then Break
if x6*10000 <> round(d6 * 10000) then Break

Break // if no break before, it's okay.

SQLNumericMBS.NumericWithDouble(value as Double) as SQLNumericMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method SQL MBS SQL Plugin 14.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Creates a new number with the given double value.

SQLNumericMBS.NumericWithInt64(value as Int64) as SQLNumericMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method SQL MBS SQL Plugin 14.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Creates a new number with the given Int64 value.

SQLNumericMBS.NumericWithString(value as string) as SQLNumericMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method SQL MBS SQL Plugin 14.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Creates a new number with the given string value.

If string is empty, we return a number with zero as value.

SQLNumericMBS.NumericWithUInt64(value as UInt64) as SQLNumericMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method SQL MBS SQL Plugin 14.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Creates a new number with the given unsigned integer value.

The items on this page are in the following plugins: MBS SQL Plugin.


The biggest plugin in space...