Cancel
Showing results for
Search instead for
Did you mean:
Highlighted

# Decimal

Pioneer

Hi everyone,

I'm using an HTMLrapport to collect results. The results (time and amount) is in 11 or 12 decimals. How can I  change this is 1 or 2 decimals?

Greetings,

Paul

5 REPLIES 5

# Re: Decimal

Siemens Phenom

You can set the max. number of places behind the decimal point as an argument like this:

[Line.length, 2]

If you want do display an exact number of decimal places (even if the places are zero) you can do it like this:

[Line.length, 02]

_________________________________________________________________
Did you like the answer? Then click the Thumbs Up button.
Did the answer solve your problem? Then accept the answer as solution.

# Re: Decimal

Pioneer

Thanks for replying.

But how do I put an argument in the HTMLreport?

```#Geproduceerde volumes
**Totale productie = [FluidDrain.statThroughput]**
**Productie per dag = [FluidDrain.statThroughputPerDay]**
**Productie per uur = [FluidDrain.statThroughputPerHour]**```

The above is one section of my report. The results of this are with 11 decimals but 2 is enough. When I put your argument behind it iw does not work. What am I doing wrong?

Paul

# Re: Decimal

Phenom

Hello, have just tested (using a normal Drain) and their suggested edit should work.

```#Geproduceerde volumes
**Totale productie = [FluidDrain.statThroughput,2]**
**Productie per dag = [FluidDrain.statThroughputPerDay,2]**
**Productie per uur = [FluidDrain.statThroughputPerHour,2]**```

On a quick side note, when using '02' to display 2 decimal places reguardless I have noticed it only works for real values and not for integers or time values.

JamesM

# Re: Decimal

Pioneer

Hi James,

Thanks, this works!

Do you maybe know a way to do this same thing for times?

Greetings,

Paul

# Re: Decimal

Siemens Phenom

This actually also works for times (for example [SingleProc.statFailTime, 2] ), except if the time is read from a global variable. Although the precision argument generally works for global variables too, it does not work for global variables of data type time (which seems to be a bug).

As a workaround, instead of writing [Variable, 2], you can write [Variable.value, 2]

Note: For some reason the leading zero does not work for the data type time.

_________________________________________________________________
Did you like the answer? Then click the Thumbs Up button.
Did the answer solve your problem? Then accept the answer as solution.