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 / C++ / MFC
  4. MFC Question

MFC Question

Scheduled Pinned Locked Moved C / C++ / MFC
questionc++help
4 Posts 4 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.
  • N Offline
    N Offline
    NewbieStats
    wrote on last edited by
    #1

    Hey long time no see! Anywayz, What would be the easiest way to get IDC_EDIT1 (total amount) be split into dollars and change... IDC_EDIT1 (Total) = 1.50 IDC_EDIT2 (Dollars) = 1.00 IDC_EDIT3 (Change) = 0.50 How would i split 1.50 into 1.00 and 0.50? Or how would i split $15.68 into $15.00 and 0.68? Any help would b greatful, nice to see you all again! /* Just a Human Trying to Live in a Computers World. */

    G T B 3 Replies Last reply
    0
    • N NewbieStats

      Hey long time no see! Anywayz, What would be the easiest way to get IDC_EDIT1 (total amount) be split into dollars and change... IDC_EDIT1 (Total) = 1.50 IDC_EDIT2 (Dollars) = 1.00 IDC_EDIT3 (Change) = 0.50 How would i split 1.50 into 1.00 and 0.50? Or how would i split $15.68 into $15.00 and 0.68? Any help would b greatful, nice to see you all again! /* Just a Human Trying to Live in a Computers World. */

      G Offline
      G Offline
      G_S
      wrote on last edited by
      #2

      if i understand correctly you wand this double dTotalSize = 15.68; //Split the dollar and the cents int iDollar = (int)dTotalSize; double dCent = dTotalSize - iDollar; G_S

      1 Reply Last reply
      0
      • N NewbieStats

        Hey long time no see! Anywayz, What would be the easiest way to get IDC_EDIT1 (total amount) be split into dollars and change... IDC_EDIT1 (Total) = 1.50 IDC_EDIT2 (Dollars) = 1.00 IDC_EDIT3 (Change) = 0.50 How would i split 1.50 into 1.00 and 0.50? Or how would i split $15.68 into $15.00 and 0.68? Any help would b greatful, nice to see you all again! /* Just a Human Trying to Live in a Computers World. */

        T Offline
        T Offline
        ThatsAlok
        wrote on last edited by
        #3

        NewbieStats wrote: How would i split 1.50 into 1.00 and 0.50? Or how would i split $15.68 into $15.00 and 0.68? float a=15.68; IDC_EDIT2 (Dollars) = int(a); IDC_EDIT3 (Change) = a-int(a);

        "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow

        cheers, Alok Gupta

        1 Reply Last reply
        0
        • N NewbieStats

          Hey long time no see! Anywayz, What would be the easiest way to get IDC_EDIT1 (total amount) be split into dollars and change... IDC_EDIT1 (Total) = 1.50 IDC_EDIT2 (Dollars) = 1.00 IDC_EDIT3 (Change) = 0.50 How would i split 1.50 into 1.00 and 0.50? Or how would i split $15.68 into $15.00 and 0.68? Any help would b greatful, nice to see you all again! /* Just a Human Trying to Live in a Computers World. */

          B Offline
          B Offline
          Bob Stanneveld
          wrote on last edited by
          #4

          Hello, If you have CString's than this code will do the trick for you: CString sTotal = "15.68"; CString sChange = "0." + sTotal.Right(2); CString sDollars = sTotal.Left(sTotal.Find('.')) + ".00"; Hope this helps. I also got the blogging virus..[^]

          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