windmueller Posted September 16, 2016 Share Posted September 16, 2016 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.CheersWindmueller Link to comment
Duncan Posted September 19, 2016 Share Posted September 19, 2016 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,23You can use a hash for optional digits, then you'll get just 478Builder.InsertClosedTableDataElement ReportingAssistant.NumberFormat(Site.AsIWaspSite.Elevation,"#000")Hope that helps!Duncan. Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now