Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Convert decimal number into Italian formate while export to excel.

Convert decimal number into Italian formate while export to excel.

Scheduled Pinned Locked Moved ASP.NET
helpregex
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    attalurisubbu
    wrote on last edited by
    #1

    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.

    J 1 Reply Last reply
    0
    • A attalurisubbu

      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.

      J Offline
      J Offline
      Jorgen Andersson
      wrote on last edited by
      #2

      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.

      A 1 Reply Last reply
      0
      • J Jorgen Andersson

        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.

        A Offline
        A Offline
        attalurisubbu
        wrote on last edited by
        #3

        Thanks alot as per you suggestion i did its working fine. Regards, Subbu.

        J 1 Reply Last reply
        0
        • A attalurisubbu

          Thanks alot as per you suggestion i did its working fine. Regards, Subbu.

          J Offline
          J Offline
          Jorgen Andersson
          wrote on last edited by
          #4

          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.

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups