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. VB & International Number Format

VB & International Number Format

Scheduled Pinned Locked Moved Visual Basic
questioncareer
2 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.
  • T Offline
    T Offline
    Thomas Blenkers
    wrote on last edited by
    #1

    Hi folks, I'm rather inexperienced with VB, but since this is pretty easy with VC, I hope some of you gurus out there has done it before or has a hint. Think of a calculation, where you have a result of, 3/4 = 0.75 If I simply use the code ResultWindow = 3/4 the VB form will display "0.75" as desired. BUT: some languages, including German, use a different format, the figure above should be written "0,75" Speaking Windows, I'd rather get and put the number format as specified in the control panel. Anyone has an idea to do VB excatly this? Thomas BTW: for VC, this piece of code in OnInitInstance does all the job: setlocale( LC_ALL, "" );

    K 1 Reply Last reply
    0
    • T Thomas Blenkers

      Hi folks, I'm rather inexperienced with VB, but since this is pretty easy with VC, I hope some of you gurus out there has done it before or has a hint. Think of a calculation, where you have a result of, 3/4 = 0.75 If I simply use the code ResultWindow = 3/4 the VB form will display "0.75" as desired. BUT: some languages, including German, use a different format, the figure above should be written "0,75" Speaking Windows, I'd rather get and put the number format as specified in the control panel. Anyone has an idea to do VB excatly this? Thomas BTW: for VC, this piece of code in OnInitInstance does all the job: setlocale( LC_ALL, "" );

      K Offline
      K Offline
      Konstantin Vasserman
      wrote on last edited by
      #2

      Take a look at FormatNumber() and FormatCurrency() functions.

      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