Results 1 to 4 of 4

Thread: Formating currency

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jul 2000
    Location
    Stockholm, Sweden
    Posts
    83

    Talking

    I want an input field for a amount and I want it to look something like #0.00. The problem is that the program will be used with diffrent regional settings. That means that sometime it will be a decimal "," and sometimes a decimail ".".

    I have treid to use a textbox but is that the smartest way to get it to display "5.60" or "5,60" depending to the settings then the user enters "5.6" or "5,6". I also want to convert it to a Long by multiply it with 100.
    Yesterday, all my troubles seemed so far away...
    Help, I need somebody, Help...
    Now MCSD and still locking for intresting job in the south parts of Stockholm, Sweden.

  2. #2
    Frenzied Member Buzby's Avatar
    Join Date
    Jan 1999
    Location
    UK
    Posts
    1,670
    Auto-formatting currency boxes have always been a pain in the ass. You could try the masked edit box control that's shipped with VB - or you could buy an add-on component from http://www.componentsource.com - search there for controls. Most of them have free eval copies so you can find a good one. I know Apex do one (www.apexsc.com) but they bundle it along with many other data-aware controls and it's quite expensive.

    'Buzby'
    Visual Basic Developer
    "I'm moving to Theory. Everything works there."

  3. #3
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649
    Try using the Format function:
    Code:
    Text1 = Format$(Text1, "0.00")
    Good luck!

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Jul 2000
    Location
    Stockholm, Sweden
    Posts
    83
    Thanks Joacim, I got the format OK !

    My next question is how to get out 1.35 from both "1.35" and "1,35", is there a VB function or do I have to do it by my self ?

    [Edited by AKA on 08-24-2000 at 01:09 AM]
    Yesterday, all my troubles seemed so far away...
    Help, I need somebody, Help...
    Now MCSD and still locking for intresting job in the south parts of Stockholm, Sweden.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width