473,407 Members | 2,676 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

Formating Inputes

I am currently puting finishing touches to a Tax Computin Software. But I am worried about the number of decimal place the program displays - Four decimal place. And some of the fields display only one decimal place while some do not at all!

The program has Basic Salary, Housing Allowance ..., Gross Pay , Reliefs, Taxable Pay, Annual Tax payable, and Monthly Tax Payable fields. I declared all the variables As Currency.

I want the program to display only two decimal place. From the Visual Basic 6 books I use, it is clear that Currency Data type estimates to four decimal place.

Please what do I do to make the program display only two decimal place?

Below is part of my codes:
If Val(txtTaxablePay.Text) <= 30000 Then
a = Val(txtTaxablePay.Text) * 0.05
txtAnnualTaxPayable.Text = a
ElseIf Val(txtTaxablePay.Text) <= 60000 Then
b = Val(txtTaxablePay.Text) - 30000
a = 30000 * 0.05
c = b * 0.1
txtAnnualTaxPayable.Text = a + c
ElseIf Val(txtTaxablePay.Text) <= 110000 Then
b = Val(txtTaxablePay.Text) - 60000
a = 30000 * 0.05
c = 30000 * 0.1
d = b * 0.15
txtAnnualTaxPayable.Text = a + c + d
ElseIf Val(txtTaxablePay.Text) <= 160000 Then
b = Val(txtTaxablePay.Text) - 110000
a = 30000 * 0.05
c = 30000 * 0.1
d = 50000 * 0.15
e = b * 0.2
txtAnnualTaxPayable.Text = a + c + d + e
ElseIf Val(txtTaxablePay.Text) > 160000 Then
b = Val(txtTaxablePay.Text) - 160000
a = 30000 * 0.05
c = 30000 * 0.1
d = 50000 * 0.15
e = 50000 * 0.2
f = b * 0.25
txtAnnualTaxPayable.Text = a + c + d + e + f

End If
curMonthlyTaxPayable = Val(txtMonthlyTaxPayable.Text)

txtMonthlyTaxPayable.Text = Format(curMonthlycurTaxPayable, "Currency")


Thank you.

Akinyemi
Dec 28 '06 #1
0 825

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Polar | last post by:
I have a database that stories entries of short stories for a writers website. I can easily input the data into MYSQL but my trouble lies in retrieving the data. the story in just cut and...
2
by: Jamie Fryatt | last post by:
I have a querystring that passes through the value 001 for example, the form on the receiving page need to display that number but with 1 added to it. i have dim strnum strnum =...
2
by: The Pistoleer | last post by:
I'm looking for information (links) on formating a page intended for printing. Something more refined than the browser print menu, which tends to pring extra information in the header and footer....
0
by: rodrigo guerra | last post by:
where i can change the code formating that visual studio does in the code.... like if i type: if ( ) { .... } visual studio changes to:
3
by: Smiley | last post by:
Hi, I know how to do confitional formating in Excel by clicking the wizard. Is this possible in MS Access ? If so, please directly where to look. I found example but nothing as to how to do it....
12
tolkienarda
by: tolkienarda | last post by:
hi all I am working on a content management service and i need some help keeping formating. what i am doing is recreating my site in an admin side and all of the articles on the site will...
1
by: Shawn Northrop | last post by:
I just read an article on kirupa.com about incorporating mySQL and PHP with flash. I am dynamically loading conent into a flash movie and am not sure how to format. In my php code i have: $y = "";...
0
by: Fonix | last post by:
I'm trying to make table border with pyExcelerator. As i can see there is only cell formating!? If i'm wrong pls tell me what is method to make more then one cell to have same format, other then...
2
by: sitko | last post by:
Hi, I'm in the process of converting a VB.net program into a C program so it can run on a unix like machine. I've been moving along at a nice pace, but this conversion has stumped me. I need...
6
by: sitko | last post by:
Hi, I've continued with my VB->C conversion, and have it working on the Linux box, now I'm going back and getting it to work on the Windows box. Something strange occurred and I thought I'd...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.