Jump to content

How to change the decimal place?


Recommended Posts

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
Link to comment
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.
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...