Decimal datatype in properties

K

kurt sune

Hi,
I am trying to do a property on a class with datatype decimal including
scale and precision.
Thus:
Private _Code2 As Decimal(3,2)

Public Property Code2() As Decimal(3,2)

Get

Return _Code2

End Get

Set(ByVal value As Decimal(3,2))

_Code2 = value

End Set

End Property


Unfortunately this doesnt work. Intellisense believes I am trying o do an
array.

Is it possible to include scale and precision in decimal datatype?

If not: Anybody has a tip on workaround? Raising error in Get/Set if value
is wrong?

/k
 
M

Mattias Sjögren

Is it possible to include scale and precision in decimal datatype?

Not the way you want to do it, no. There is a scale associated with
the decimal value, but it's an instance property, not a property of
the type.



Mattias
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top