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
Var c1 as Currency = 12345678.
Var c2 as Currency = 1234567.8
Var c3 as Currency = 123456.78
Var c4 as Currency = 12345.678
Var c5 as Currency = 1234.5678
Var c6 as Currency = 123.45678

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

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

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

Var x1 as Currency = n1.CurrencyValue
Var x2 as Currency = n2.CurrencyValue
Var x3 as Currency = n3.CurrencyValue
Var x4 as Currency = n4.CurrencyValue
Var x5 as Currency = n5.CurrencyValue
Var 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...