Convert decimal number into Italian formate while export to excel.
-
Hi all, As per the requirement my machine language settings are set to Italian language. while generating reports in my application i am facing a problem that i have a column called timespent lets say eg: 1.5 units We are showing the report in excel formate. Note:- In Italian formate "1.5" should be display as "1,5" ------ I am applying following style to out put record set of "TIME_SPENT" but i am getting the out put '1.5 but required Output is "1,5" sbrHTML.Append(".timespend { mso-number-format:@;} .premium { mso-number-format:$\\#\\,\\#\\#0\\.00;} .ogDate {mso-ignore:padding;mso-generic-font-family:auto;mso-font-charset:0;mso-number-format:yyyy-MM-dd;mso-background-source:auto;mso-pattern:auto;} "); sbrHTML.Append("" + sqlDatareader["TIME_SPENT"].ToString() + ""); out put:'1.5 Please can any can help on this. Thanks in advance, subbu.
-
Hi all, As per the requirement my machine language settings are set to Italian language. while generating reports in my application i am facing a problem that i have a column called timespent lets say eg: 1.5 units We are showing the report in excel formate. Note:- In Italian formate "1.5" should be display as "1,5" ------ I am applying following style to out put record set of "TIME_SPENT" but i am getting the out put '1.5 but required Output is "1,5" sbrHTML.Append(".timespend { mso-number-format:@;} .premium { mso-number-format:$\\#\\,\\#\\#0\\.00;} .ogDate {mso-ignore:padding;mso-generic-font-family:auto;mso-font-charset:0;mso-number-format:yyyy-MM-dd;mso-background-source:auto;mso-pattern:auto;} "); sbrHTML.Append("" + sqlDatareader["TIME_SPENT"].ToString() + ""); out put:'1.5 Please can any can help on this. Thanks in advance, subbu.
Excel does not support decimal, which means it's exported as string instead. Try converting to double before exporting. Or converting to string yourself using the correct locale before exporting.
My postings are a natural product. The slight variations in spelling and grammar enhance their individual character and beauty and are in no way to be considered flaws or defects.
-
Excel does not support decimal, which means it's exported as string instead. Try converting to double before exporting. Or converting to string yourself using the correct locale before exporting.
My postings are a natural product. The slight variations in spelling and grammar enhance their individual character and beauty and are in no way to be considered flaws or defects.
Thanks alot as per you suggestion i did its working fine. Regards, Subbu.
-
Thanks alot as per you suggestion i did its working fine. Regards, Subbu.
You're welcome
My postings are a natural product. The slight variations in spelling and grammar enhance their individual character and beauty and are in no way to be considered flaws or defects.