|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
I created a heating oil calculator. This little program tells you how much oil exist in your tank.
It also will tell you the total price once you enter the price per gallon. I find it to be a cool program. The program is completed but not deployed or packaged. I have a textbox where a user can enter the meter reading, which is in fractions. My program can only be used in decimal equivalent. I would like to change that into using a fraction instead. Here is the code : The PreNumGal is where the user will enter the meter reading. I can only use the decimal equivalent in order to work. I need to use a fraction rather than using the decimal. (e.g Not use 0.25, use 1/4) Can anyone help me. PrivateSub btnCalculate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCalculate.Click Dim NumGal, PriceGal, ExistNumGal, NumGalNeeded, TotPriceGal AsInteger Dim PreNumGal AsShort txtExistNumGal.Text = txtNumGal.Text * txtPreNumGal.Text txtNumGalNeeded.Text = txtExistNumGal.Text - txtNumGal.Text txtTotPriceGal.Text = txtNumGalNeeded.Text * txtPriceGal.Text txtTotPriceGal.Text = Format(txtTotPriceGal.Text, "Currency") txtPriceGal.Text = Format(txtPriceGal.Text, "Currency") EndSub Last edited by bravo659 : September 14th, 2004 at 12:56 AM. Reason: Mispelled word |
![]() |
| Viewing: Dev Articles Community Forums > Programming > .NET Development > Heating Oil Calculator |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|