104
Views
7
Comments
Solved
[OutSystems Data Grid Web] Why the decimal point of the digital data I output only has two digits in Data Grid
outsystems-data-grid-web
Web icon
Forge asset by OutSystems
Application Type
Traditional Web
Service Studio Version
11.54.6 (Build 62311)
Platform Version
11.54.6 (Build 62311)

Hi everyone 

Forge of Data Grid Web is used in the program.

As the picture shows, I set the DataType of the column to Decimal, and then the value obtained by dividing 0.001 by 1000 is displayed on the screen, the screen uses the GridColumnNumber widget, but the screen indicates 0.00, not 0.000001. only two digits are displayed, not all. When downloaded to excel, there are also only two decimal places. 

What should I do if I want to display all decimals when the DataType must be Decimal?

Screen display result

Excel download result


Any suggestion is appreciated.

Kind Regards

2022-07-19 16-56-14
Giuliana Silva
Staff
Solution

Hi @YITONG LYU ,

In the link I sent you above there are more formatting options you can try. I believe that the one you are seeking is the g* specifier. Check the example below:

Regards,

Giuliana.

UserImage.jpg
Won Jien Liew

Hi Yi Tong,

I believe you are trying to populate the number with decimal places in table. Try to check the format expression used to display the netweight.


2024-12-24 00-58-47
YITONG LYU

@Won Jien Liew 

Thank you Replay.

Above is the example I gave for the following data.

On the left is the data and processing in the table, and on the right is the data that I want to display on the screen

1. 4200.000 → 4200

2. 0.001/1000 → 0.000001

3. 32566/1000 → 32.566

What is the best way to do it?

UserImage.jpg
Won Jien Liew

If there is no specific format that you want to set for decimals, you can directly use the variable without FormatDecimal function. The expression is smart enough to automatically adjust its format based on the respective value.

  • FormatDecimal(decimalVariable, 2, ".", ",") → decimalVariable 


https://success.outsystems.com/documentation/11/reference/outsystems_language/logic/built_in_functions/format/#FormatDecimal

2022-07-19 16-56-14
Giuliana Silva
Staff

Hi, @YITONG LYU 

Have you tried using the AdvancedFormat field in GridColumnNumber? There you can set the number format you want based on Wijmo's formatting options.

Here is an example of how to use it:

Regarding the excel file, there is nothing we can do about it since it is an Excel default behavior. You will need to check how to format the Excel column to display the decimal places you want.


Regards,

Giuliana.

2024-12-24 00-58-47
YITONG LYU

@Giuliana Silva 

Thank you for your Replay.

I tried the method you described. I set that to format:n6.

All decimals are turned into six digits. 

Example: 

0.23 → 0.230000

1 → 1.000000

0.00001 → 0.000010

I don't want to fix the number of decimal places, just display as many as there are.

Example: 

0.23 → 0.23

1 → 1

0.00001 → 0.00001

What is the best way to do it? 

2022-07-19 16-56-14
Giuliana Silva
Staff
Solution

Hi @YITONG LYU ,

In the link I sent you above there are more formatting options you can try. I believe that the one you are seeking is the g* specifier. Check the example below:

Regards,

Giuliana.

2024-12-24 00-58-47
YITONG LYU

@Giuliana Silva 

Thank you very much. 

The result I wanted displayed on the screen now. 

But the excel download automatically complements 0.

Here's how I downloaded my excel and the excel download result.

How can I get the excel results to be the same as on the screen?

Any suggestion is appreciated.

Kind Regards

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.