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. General Programming
  3. C#
  4. EPPLUS excel percent format

EPPLUS excel percent format

Scheduled Pinned Locked Moved C#
question
4 Posts 3 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.
  • U Offline
    U Offline
    User 9123917
    wrote on last edited by
    #1

    May I know how can I convert a decimal (eg: 0.3333) to percent format. I have tried with this code: ws.Cells[1,1].Value = 0.3333; ws.Cells[1.1].Style.Numberformat.Format = "0%"; But this give me 33% instead of 33.33%

    L J 2 Replies Last reply
    0
    • U User 9123917

      May I know how can I convert a decimal (eg: 0.3333) to percent format. I have tried with this code: ws.Cells[1,1].Value = 0.3333; ws.Cells[1.1].Style.Numberformat.Format = "0%"; But this give me 33% instead of 33.33%

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Did you try "0.00%"?

      One of these days I'm going to think of a really clever signature.

      U 1 Reply Last reply
      0
      • L Lost User

        Did you try "0.00%"?

        One of these days I'm going to think of a really clever signature.

        U Offline
        U Offline
        User 9123917
        wrote on last edited by
        #3

        It's work! Thank you so much. :)

        1 Reply Last reply
        0
        • U User 9123917

          May I know how can I convert a decimal (eg: 0.3333) to percent format. I have tried with this code: ws.Cells[1,1].Value = 0.3333; ws.Cells[1.1].Style.Numberformat.Format = "0%"; But this give me 33% instead of 33.33%

          J Offline
          J Offline
          Jay Nardev
          wrote on last edited by
          #4

          double t = 0.3333; Console.WriteLine(t.ToString("##.##%"));

          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