Support Forum

Number of decimals


In the Gld programming, there is a parameter, so that a dimension value, when there are zeros after the comma, shows them, and also how to delimit the number of decimals
I will explain myself better a dimension 1.234 is the one written with three decimals I would like 1.23 and if a value is 3.00 now it shows me 3
attached image.
Sincerely.

Anhänge (1)

Typ: image/x-ms-bmp
870-mal heruntergeladen
Größe: 1,47 MiB

Use Syntax
STR (numeric_expression, length, fractions)

Anhänge (1)

Typ: image/png
50-mal heruntergeladen
Größe: 29,47 KiB

Good afternoon Nemo.
Thanks for your answer. I use the syntax, but I can't reduce the decimals.
I attach several images:
image 1 smartpart with the result.
image 2 the V_COT value
Image 3 line 111 Syntax, 112 text V_COT

Anhänge (3)

Typ: image/x-ms-bmp
836-mal heruntergeladen
Größe: 522,55 KiB
Typ: image/x-ms-bmp
923-mal heruntergeladen
Größe: 62,47 KiB
Typ: image/x-ms-bmp
868-mal heruntergeladen
Größe: 159,20 KiB

Hello,

Nemo gave an example. Please, read the online help on the bottom of the SmartPart editor.
If you need to change the value of V_COT, you have to apply the value to the variable, like this:
V_COT = STR ( your_numeric_value , 1 , 2 )
So, you get your value with 2 decimals.

And, please, use modern image format like JPG or PNG as attached image. Then, we don't need to download the file, but it can be open directly in the web browser. Gracias.


Good morning Bertran.
First thank you for your help.
Apply the syntax that Nemo indicated to me, perhaps it is very simple, but it is difficult for me to make it work correctly, or understand how to apply it correctly on my part.
My reason is that I am making a text that would be the sum of two parameters HORIT+VERTI attached image 1.
In the Script 2D programming I make a variable called V_COT = (VERTI+HORIT) image 2, which I will use to put that value in image 3..
I understand the syntax concept, which Nemo told me, but I don't know how to apply it.
image 4, I apply str (1.234,4,2) , but when I run the 2D Script it complains.
Thanks in advance for your dedicated time.
Thanks.

Anhänge (2)

Typ: image/jpeg
17-mal heruntergeladen
Größe: 88,87 KiB
Typ: image/jpeg
36-mal heruntergeladen
Größe: 67,44 KiB

Hola Toni,

Do only this:

V_COT = STR ( VERTI + HORIT , 1 , 2 )

When Nemo wrote "STR ( 1.234 , 4 , 2 )", the value "1.234" was the number to convert into string.
If you read the help on the bottom of the SmartPart editor, you can see how the syntax works.


Good afternoon Bertrand.
Thank you very much for your help,
Sincerely.