Problem with Decimal values
-
- Posts: 70
- Joined: Wed Feb 24, 2010 11:08 am
- Location: India
Problem with Decimal values
Dear Sir
I am using a firebird table which has lot of decimal type columns. In firebird the data is displayed properly i.e. 4.00 is displayed as 4.00 but in stimulsoft, 4.00 is displayed as 4. That created some unexpected problem for me . Actually i have a column height decimal(6,2) which stores heights of students in a school. The height is entered as 4.11 for some one having height of 4 feet and 11 inches. I tried to display it as 4'11" by first converting the decimal to string and replacing . with ' and appending the resulting string with a ". It went well for all the values except 4 and 5 which were printed as 4" and 5". That happened because stimulsoft treated 4.00 as 4 and 5.00 as 5. Is there any workaround ? I am not aware if it happens with other databases like sql server and mysql also.
Thanks in advance !!
Naveen Aggarwal
I am using a firebird table which has lot of decimal type columns. In firebird the data is displayed properly i.e. 4.00 is displayed as 4.00 but in stimulsoft, 4.00 is displayed as 4. That created some unexpected problem for me . Actually i have a column height decimal(6,2) which stores heights of students in a school. The height is entered as 4.11 for some one having height of 4 feet and 11 inches. I tried to display it as 4'11" by first converting the decimal to string and replacing . with ' and appending the resulting string with a ". It went well for all the values except 4 and 5 which were printed as 4" and 5". That happened because stimulsoft treated 4.00 as 4 and 5.00 as 5. Is there any workaround ? I am not aware if it happens with other databases like sql server and mysql also.
Thanks in advance !!
Naveen Aggarwal
Problem with Decimal values
Hello,
Please try to use the following expression:
Thank you.
Please try to use the following expression:
Code: Select all
{(4.00).ToString("n2").Replace(",", ".").Replace(".", "'") + '"'}
-
- Posts: 70
- Joined: Wed Feb 24, 2010 11:08 am
- Location: India
Problem with Decimal values
Thanks a lot for your reply sir !
As i mentioned, the data is coming from decimal column in a table. Will it work in the same way if i replace (4.00) with the column name. Main problem is that Stimulsoft treats 4.00 as 4.
Regards !
As i mentioned, the data is coming from decimal column in a table. Will it work in the same way if i replace (4.00) with the column name. Main problem is that Stimulsoft treats 4.00 as 4.
Regards !
-
- Posts: 70
- Joined: Wed Feb 24, 2010 11:08 am
- Location: India
Problem with Decimal values
Dear Sir
I tried the expression suggested by you ! It has resulted in one more problem, the value 4.5 is now printed as 4'50" which is not the way i want. It will give an idea that height is 4 feet and 50 inches which is not correct. Any other workaround if possible ?
Thanks in advance !!
I tried the expression suggested by you ! It has resulted in one more problem, the value 4.5 is now printed as 4'50" which is not the way i want. It will give an idea that height is 4 feet and 50 inches which is not correct. Any other workaround if possible ?
Thanks in advance !!
Problem with Decimal values
Hello.
You can do it using your function. Please, look at code in attached report.
Thank you.
You can do it using your function. Please, look at code in attached report.
Thank you.
- Attachments
-
- 1339.Report.mrt
- (3.69 KiB) Downloaded 210 times
-
- Posts: 70
- Joined: Wed Feb 24, 2010 11:08 am
- Location: India
Problem with Decimal values
Thanks a lot for your reply sir !!
I did have a look at the report sent by you but was not able to find the definition of the function ToInches.
How can i write my own function and pass to the report !!
Thanks a lot in advance !!
I did have a look at the report sent by you but was not able to find the definition of the function ToInches.
How can i write my own function and pass to the report !!
Thanks a lot in advance !!
Problem with Decimal values
Hello.
Thank you.
You can find it in the Code tab. Your function must be before this string:naveenagg wrote:I did have a look at the report sent by you but was not able to find the definition of the function ToInches.
How can i write my own function and pass to the report !!
Code: Select all
#region StiReport Designer generated code - do not modify