| | |
Help a Brazilian programmer urgent, please!
Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Oct 2009
Posts: 2
Reputation:
Solved Threads: 0
Hello, I represent a company developing software in Brazil.
I wonder why my program (VB6)
reading a number stored in the notepad, it reads
the decimal number.
for example if the value is stored 30.5
will display the value in textbox 305
how to make it understand the point.
Thanks
I wonder why my program (VB6)
reading a number stored in the notepad, it reads
the decimal number.
for example if the value is stored 30.5
will display the value in textbox 305
how to make it understand the point.
Thanks
Last edited by Domus BRASIL; Oct 7th, 2009 at 1:15 pm.
•
•
Join Date: Mar 2009
Posts: 921
Reputation:
Solved Threads: 167
0
#3 Oct 8th, 2009
It may also depend upon your local settings on your computer. I don't know about brazil but some countries use the decimal/period character as a thousands seperator and since you have 30.5 and not 30.500 it may be stripping it.
So to perhaps solve this you may want to read the value into a string and then convert to a double.
Good Luck
So to perhaps solve this you may want to read the value into a string and then convert to a double.
Good Luck
If anyone has helped you solve your problem, please mark your thread as solved.
Thanks
Thanks
•
•
Join Date: Mar 2009
Posts: 921
Reputation:
Solved Threads: 167
0
#5 Oct 8th, 2009
So, you first read the value in from a text file, right? So at that point you have "30.5". Then somewhere it gets changed, right?
Good Luck
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
Dim SomeVariable As Double SomeVariable = CDbl("30.5")
Good Luck
If anyone has helped you solve your problem, please mark your thread as solved.
Thanks
Thanks
0
#6 Oct 9th, 2009
Yes correct all your variable declarations.
•
•
Join Date: Jan 2008
Posts: 255
Reputation:
Solved Threads: 38
0
#8 Oct 26th, 2009
You can also try your textbox format -
You can also try this sub I've done some while back
Hope this helps.
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
Text1.text = Format(Text1.text, "### ###.##") 'Where ## is the actual number entered into text box.
You can also try this sub I've done some while back
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
Public Function Txtnumdeci(Key As Integer, Strinfo As String) As Integer Dim Deciprs As Boolean Dim Ctr As Integer Dim Decipos As Integer Decipos = InStr(Strinfo, ".") If Decipos Then Deciprs = True Else Deciprs = False End If Select Case Key Case vbKey0 To vbKey9 If Deciprs = True Then Ctr = Len(Mid(Strinfo, Decipos + 1, Len(Strinfo) - Decipos + 1)) If Ctr = 2 Then Txtnumdeci = 0 Else Txtnumdeci = Key End If Else Txtnumdeci = Key End If Case vbKeyBack Txtnumdeci = Key Case vbKeyDecimal, Asc(".") If Deciprs = True Then Txtnumdeci = 0 Else Txtnumdeci = Key End If Case vbKeyReturn SendKeys "{TAB}" Case Else Txtnumdeci = 0 End Select End Function
Hope this helps.
Please mark questions as answered when done.
Be the ONE!!!
Be the ONE!!!
![]() |
Similar Threads
- Immediate Hire: PHP Programmer (Web Development Job Offers)
- Lead Programmer Position (Web Development Job Offers)
- PHP/MySQL Programmer Position (Web Development Job Offers)
- Python and/or C Programmer (Software Development Job Offers)
- Python/Java/Ogre Programmer Needed (Software Development Job Offers)
- PHP Web Programmer (Post your Resume)
- jar files (urgent) (JSP)
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: Comparing first & last letter of a string
- Next Thread: viewing database
Views: 1061 | Replies: 7
| Thread Tools | Search this Thread |
Tag cloud for basic, microsoft, vb6, visual, web
advertising age ajax amd android apple asp avatar ballmer basic beta billgates bing bluegene browser business chips cloudcomputing database design developer development dos economy energy enterprise firefox games gaming google hardware hosting ibm ibm.news ie8 intelibm internet internetexplorer iphone ipod leopard linux mac marketing medicine memory microsoft mobile mozilla news nintendo novell office openoffice opensource opera operating operatingsystem operatingsystems os pc privacy ps3 recession redhat russia search security server sex software sql steveballmer sun supercomputer supercomputing survey system technology tiger trends ubuntu unix upgrade vb6 virtualization vista visual web wii windows windows7 working x86 xbox xbox360 xp yahoo yahoo! zune







