#1 2016-09-16 09:10:34

windmueller
Member
Registered: 2009-12-14
Posts: 15

How to change the decimal place?

Dear Wasp community,

is there a Html command in the script which changes the decimal places in the report view e.g from 5,67 to 5.

In particular I would like to have the values for the Elevation without a decimal place. This is the Html therefore: "...Builder.InsertClosedTableDataHeaderRowElement "Elevation [m] a.s.l."
...Builder.InsertClosedTableDataElement Site.AsIWaspSite.Elevation..."

I hope you have an idea - will apreciate it.

Cheers
Windmueller

Offline

#2 2016-09-19 16:34:56

Duncan
WAsP team
From: Europe
Registered: 2009-05-14
Posts: 286

Re: How to change the decimal place?

Hello,

There is an object called ReportingAssistant which you can use to get the effects you want.

For using a US/UK style decimal marker, there is a function called FormatValueWithPointDecimal. This was added to help making correct XML output, I think. Anyway, the full line would look like this:

Builder.InsertClosedTableDataElement ReportingAssistant.FormatValueWithPointDecimal(Site.AsIWaspSite.Elevation)

For rounding off the non integer part, you can use another function called NumberFormat, in which you can pass a standard VB formatting string using zero and hash markers, for example:

Builder.InsertClosedTableDataElement ReportingAssistant.NumberFormat(Site.AsIWaspSite.Elevation,"0000")

This will give you something like 0478 for a height like 478,23

You can use a hash for optional digits, then you'll get just 478

Builder.InsertClosedTableDataElement ReportingAssistant.NumberFormat(Site.AsIWaspSite.Elevation,"#000")

Hope that helps!

Duncan.

Offline

Board footer

Powered by FluxBB

[ Generated in 0.011 seconds, 10 queries executed - Memory usage: 527.38 KiB (Peak: 555.17 KiB) ]