how to add up imperial numbers?

Stimulsoft Reports.NET discussion
Post Reply
jjthed
Posts: 15
Joined: Mon Jul 07, 2014 11:36 pm

how to add up imperial numbers?

Post by jjthed »

Hello,

I am having problems adding all the imperial numbers. On the report I use the expression: {EstimateItems.LengthString}, the number shows on my report is a string such as 0'-5 3/4, so how do I change this data type to numbers so I can sum up all the numbers in imperial?
jjthed
Posts: 15
Joined: Mon Jul 07, 2014 11:36 pm

Re: how to add up imperial numbers?

Post by jjthed »

I am not sure if I have explained well enough. The number in imperial is in string format, and I need to convert them so that I can add them up. eg. 0'-5 3/4 is in string format, and I need to convert it so that I can add them up: 0'-5 3/4 + 3'-1 3/8 and gives me the answer in imperial as well. Thanks!
james.crossley
Posts: 28
Joined: Sun Aug 07, 2011 8:53 pm
Location: Auckland

Re: how to add up imperial numbers?

Post by james.crossley »

Hi jjthed

You could use this code as s starting point: http://www.codeproject.com/Tips/623477/ ... sa-in-Csha

HTH
James
jjthed
Posts: 15
Joined: Mon Jul 07, 2014 11:36 pm

Re: how to add up imperial numbers?

Post by jjthed »

Thanks for your link, but I am not a C# person, so is there anything simpler than that?
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: how to add up imperial numbers?

Post by HighAley »

Hello.
jjthed wrote:Thanks for your link, but I am not a C# person, so is there anything simpler than that?
Unfortunately, it's impossible. The Imperial units are not supported by .Net Framework.

Thank you.
jjthed
Posts: 15
Joined: Mon Jul 07, 2014 11:36 pm

Re: how to add up imperial numbers?

Post by jjthed »

Ah, thanks!

one more question, I want to calculate the total length per each group. My length has a formula that is qty * unit length per each item. Please reference the spreadsheet for reference.

So my formula for the GroupFooterBand is {Round(Sum(EstimateItems.Quantity)* EstimateItems.Length)}

What formula can I write so that it will sum up the length in each group under the PageGroupFooterBand?

Thanks,
June
Attachments
Book1.xlsx
(8.3 KiB) Downloaded 297 times
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: how to add up imperial numbers?

Post by HighAley »

Hello, June.

It's no clear what are you trying to do.
We try to guess that you should use next expression:

Code: Select all

{Round(Sum(EstimateItems.Quantity* EstimateItems.Length))}
If this doesn't help, send us a sample report template with sample data and more detailed description what do you need to get.

Thank you.
Post Reply