PC SOFT

FOROS PROFESIONALES
WINDEVWEBDEV y WINDEV Mobile

Inicio → WINDEV 2024 → 2 decimals
2 decimals
Iniciado por guest, 07,sep. 2015 16:18 - 3 respuestas
Publicado el 07,septiembre 2015 - 16:18
Hi I Have a problem,
I had a field that was defined as an int. But I need it to be a nummeric, because I need two decimals.

So I went to the analisis and changed the field to type = decimal.
interger part 32 decimal part 2

I ran the analisis update and I semd to change things.

Now I f I run a querie I get a result with no decimals. The result is 21. I need it to be 21.00

Anyone any I dea how to fix this ?

Thanks

Allard
Publicado el 07,septiembre 2015 - 21:35
Hello Allard,

What do you mean? The number is stil 21 but when you devide it by 5 it would be represented as: 4.2 and not 4.20.
In that case what is the problem? In a table display you can set it to two decimals nad it displays two decimals.
Publicado el 08,septiembre 2015 - 12:10
Hi Allard,

Also take a look at NumToString, which allows you to format a numeric value in many different ways, including specifying the number of decimals:

http://help.windev.com/en-US/…

Best regards
Ola
Publicado el 08,septiembre 2015 - 20:39
Hi

I needed it because I had to do a check againsed an xml import I now use val(item) and it works. I Still think it is strage that even with a real with 2 decimals in the analisis returns no decimals if decimals are 0 in queries.

Indeed frans in my table it has 2 decimals. And it is saved with 2 decimals in hyperfile cs. So that is good, works as expected. But i f I run a querie it returns 21 instead of 21,00.

But my problem is solved

Thanks for the response

regards
Allard