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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. Visual Basic
  4. How can i create salary format in Textbox ? for example i want create 2000.00 .

How can i create salary format in Textbox ? for example i want create 2000.00 .

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

    hi all i have one problem ,when entered salary amount in textbox its only display 2000rs , here i want 2000.00 format . Pls give me code how can i write that format (2000.00)

    R A J 3 Replies Last reply
    0
    • P pramod2517

      hi all i have one problem ,when entered salary amount in textbox its only display 2000rs , here i want 2000.00 format . Pls give me code how can i write that format (2000.00)

      R Offline
      R Offline
      Rajesh Anuhya
      wrote on last edited by
      #2

      Go Through this link http://www.java2s.com/Code/VB/Development/StringFormatCurrency.htm[^]

      Rajesh B --> A Poor Workman Blames His Tools <--

      1 Reply Last reply
      0
      • P pramod2517

        hi all i have one problem ,when entered salary amount in textbox its only display 2000rs , here i want 2000.00 format . Pls give me code how can i write that format (2000.00)

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

        Dim mySalary As Double = 2000

        txtSalary.Text = mySalary.ToString("$0.00")

        ...

        or

        Public Sub txtSalary_Validate(...)...
        If IsNumeric(txtSalary.Text) = True Then
        txtSalary.Text = CDbl(txtSalary.Text).ToString("$0.00")
        End If
        End Sub

        I don't speak Idiot - please talk slowly and clearly I don't know what all the fuss is about with America getting it's first black president. Zimbabwe's had one for years and he's sh*t. - Percy Drake , Shrewsbury Driven to the arms of Heineken by the wife

        1 Reply Last reply
        0
        • P pramod2517

          hi all i have one problem ,when entered salary amount in textbox its only display 2000rs , here i want 2000.00 format . Pls give me code how can i write that format (2000.00)

          J Offline
          J Offline
          Johan Hakkesteegt
          wrote on last edited by
          #4

          Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
          TextBox1.Text = CDbl(TextBox1.Text).ToString("F")
          End Sub

          but make sure that only numeric values are entered.

          My advice is free, and you may get what you paid for.

          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