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. Visual Basic
  4. Formatting numbers

Formatting numbers

Scheduled Pinned Locked Moved Visual Basic
questiontutorial
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.
  • E Offline
    E Offline
    erikkloeze
    wrote on last edited by
    #1

    I'm making a small program wich has to be used to input bills. Becuase of this, it will have to format numbers for me. Now, for example When I my input is 3.50 then my output has to be 3,50 AND NOT 3500!!!!! So my question is, how do you format numbers so that the "." becomes a "," ??? :confused: <<>>

    H N 2 Replies Last reply
    0
    • E erikkloeze

      I'm making a small program wich has to be used to input bills. Becuase of this, it will have to format numbers for me. Now, for example When I my input is 3.50 then my output has to be 3,50 AND NOT 3500!!!!! So my question is, how do you format numbers so that the "." becomes a "," ??? :confused: <<>>

      H Offline
      H Offline
      Hesham Amin
      wrote on last edited by
      #2

      vb6 ?

      Dim n
      n = 3500
      
      MsgBox FormatNumber(n, 0, , , vbTrue)
      
      E 1 Reply Last reply
      0
      • H Hesham Amin

        vb6 ?

        Dim n
        n = 3500
        
        MsgBox FormatNumber(n, 0, , , vbTrue)
        
        E Offline
        E Offline
        erikkloeze
        wrote on last edited by
        #3

        I think you dont get my question well... When you enter a value (for example totall bill) most people don't use a "," but a "." . But if you enter a "." in VB, he will read it as a thousand sign, so 3.50 -> 3500 . But, I want him to make a value of it so 3.50 -> € 3,50 . Eventually without the €-sign !! I hope you could now help me better ( by the way, it has to work with textboxes and not with msgboxes!!! ) (¯`·._.·[eRiK]·._.·´¯)

        1 Reply Last reply
        0
        • E erikkloeze

          I'm making a small program wich has to be used to input bills. Becuase of this, it will have to format numbers for me. Now, for example When I my input is 3.50 then my output has to be 3,50 AND NOT 3500!!!!! So my question is, how do you format numbers so that the "." becomes a "," ??? :confused: <<>>

          N Offline
          N Offline
          Nadroj
          wrote on last edited by
          #4

          maybe this function i made can help. this is for vb.net, hopefully thats wut ur using. >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Function GetEuros(ByVal num As Double) As String Dim tempNum As String = Format(num, "n") tempNum = tempNum.Replace(".", ",") Return tempNum End Function (...) Dim myNum As Double = 54.25 text1.text = GetEuros(myNum) <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< this makes text1.text = 54,25. ------------------------ Jordan. III

          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