Database column = decimal(18,4)
I know that PB can only handle 18 digit decimals...so it can handle
decimal(18,4).
I create a DW...
Without using an EDIT MASK, is there a way to control user input so it
doesn't overflow?
Meaning...as it is right now a user can input
999999999999999999999999999
then tab out of the column...it will change that number to some other
number, probably because it's overflowing and maybe trying to "round" to
something?
Of course if I use the edit mask
##,###,###,###,###.0000
or
##############.0000
This can be controlled.
So I am asking without using edit masks, is there any way to control this
from happening in the DW itself?
Thanks!!!
"Nick N." <nick.ni...@natexisblr.us> wrote in message
news:4123bedf@forums-1-dub...
For instance, you can enter up to 14 9's and still be ok but on the 15th
it'll round up...
999999999999999 would become 100000000000000
Since powerbuilder can only handle 18 digits for decimal, you can say put a
limit of 18, but that's not restrictive enough since you can overflow the
number at the 15th digit.
Obviously putting a limit of 14 isn't desireable either in this particular
situation.
That doesn't stop someone from inputting 18 9's...
999999999999999999
Which would definitely give you very strange results.
But what if you have a computed column which will take that number and
multipy by quantity...
say
base = 99999999999999.9999 (this is decimal(18, 4))
price = 9999999999.99999999 (decimal(18,10)
base x price = ?????
Definitely will overflow 18 digits and give you stragne results...or the
computed field will turn 0.0...
How does one manage this???
"Jerry Siegel" <jer...@data-sci.com.nospam> wrote in message
news:4123c14a$1@forums-1-dub...
thanks
<JMR> wrote in message news:4124a32f.4bb...@sybase.com...
"Nick N." <nick.ni...@natexisblr.us> wrote in message
news:4124e16e$1@forums-2-dub...
Fields:
qty decimal(18,4)
price decimal(18,10)
net_amt decimal(18,2)
These fields themselves are fine since it keeps with PB's definition of
decimal.
But what if there net_amt can also be a computed field via code in the
itemchanged event?
So if qty > 0 and user enters a valid price the net_amt will be calculated
and populated.
say you have these:
qty = 99999999999999.9999 ->this is decimal(18,4)
price = 99999999.9999999999 -> this is decimal(18,10)
In this case qty x price would definitely overflow PB decimal type.
How would I validate this?
It just doesn't work...I mean it's highly unlikely that this would happen
but I'm asked to look into it regardless...
"Jerry Siegel" <jer...@data-sci.com.nospam> wrote in message
news:4124e7dc$1@forums-2-dub...