JSColumn.getLength() wrong value

I just faced a situation that doesn’t have a very good impact on my database.

I just come from 3.5.8 and I use JSColumn.getLength() function.
In 3.5.8 when I have a database field of the type numeric(18,2), this method returned the number of decimals, so it returned 2

But now I migrated to 4.1.3 and I see that this same function returns 18. And because I use this function to change database types - from float to numeric(18,2) - I need to determine the exact number of decimals.
I guess this has something to do with the change that was made in 3.5.9 where also the length was ignored when entering a length in the dataprovider.

Now I can’t determine the exact size of my column. So there are 3 solutions:

  1. JSColumn.getLength() returns the number of decimals again like in 3.5.8 (in this case 2)
  2. JSColumn.getLength() returns no longer a number, but a string (in this case 18,2)
  3. JSColumn.getDecimals() is a new method that returns the number of decimals (in that case JSColumn.getLength() can return 18 and JSColumn.getDecimals() can return 2)

Servoy guys, please confirm that you can reproduce the above and please give me as soon as possible a solution.

Martin

that getLenght() gave you 2 was just a bug, because that is not the length of a column

what you want is a getScale() method on JSColumn that returns then 2
I will add that method to JSColumn

I didn’t consider it as a bug, because I used standard length 18 for my numeric fields and the nr of decimals were in the getLength(); like that I could generate ALTER COLUMN scripts.

But I agree that it is the best to have 2 methods, getLength() and getScale() like I suggested as option 3