the problem is about user when click button coin and it will display the decimal number and suppose to be like this : 0.10 also , i have made code about notes amount like RM 1.00 and RM 5.00. [code] the problem is when i run the program and click the button it become like this: RM 1.2 not RM 1.20.i also attach some pic in the first pic the coin appear normally but after i click button RM 1.00 , it become like second pic.
i am trying to make a coin toss program where you toss a coin a certain number of times then repeat it a certain number of times. the problem i have is "heads(counter2)" the word "heads" has a blue error line under it how do i sort the error out and also is all the code right
Public Class Form1 Dim tosses, repeat, heads As Integer Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
I have read plenty websites and i can not find the solution...I dont know why, i have tried many algorithms and none of them work for me. Anyone knows where can i found some dynamic programming algorithm to solve the problem of the coin change?
I have read plenty websites and i can not find the solution...I dont know why, i have tried many algorithms and none of them work for me.Anyone knows where can i found some dynamic programming algorithm to solve the problem of the coin change?
I am started learning .net. I want two decimal points value. I have used this codelblNo.Text = Math.Round(CDec(txtNo.Text + (txtNo.Text * 0.2)), 2).ToString(If i have value as 1.32 then its ok but if i have value like 2.3 it shows 2.3 but i want value as 2.30
I've gotten this 75% completed but am now stuck on 2 separate, but seemingly "simple" fixes. I've written a coin tossing program that is supposed to give a "True" answer for heads and a "False" answer for tails as well as keep a running calculation of how many times heads and tails are shown. Additionally, there needs to be a picture that shows what side comes up. Right now, I have the "True/False" answers coming up correctly, but without any images. I've also verified that the images are in the Resource folder as well as verified that the "True/False" are correct by comparing it with the results in the heads and tails label that they show up in. I've tried to display an image(s) by embedding it as a resource in a project but it does not show up. The second problem is that the results in the labels show up as 1 & 0s, not a running tally as it should be.
Here's the code that I have: Public Class Form1 Dim randomObject As New Random() Private Sub tossButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tossButton.Click Dim headscount As Integer [Code] .....
I have also tested taking out the +1 on the If/EndIf statement, which then returns only 0's in the boxes with the "True/False" still working as it should.
how can i make hexa decimal string from my own text? [code] then it will generate hexa string (below is only sample, not true generated) 3F2504E0-4F89-11D3-9A0C-0305E82C3301...is it some algorithm or function in VB NET to generate HEXA?
I am using Visual Basic Express. Here is my code but my number is always a whole number when I divide I want it to be two decimal places. For example 367/12 should equal 30.42 not just 30.
Is there a way to make NumericUpDown control hide decimal places but still can show if i entered manually?For example, i want to set NumericUpDown DecimalPlaces to 0 but when i enter something like 6.52, it remains 6.52 and not rounded to 7.
After converting all degrees-->decimal, and decimal-->hours, how can i use Tan, Cos and Sin formula in vb.net? I want the user must enter an input (which it is a coordinat-->i already convert the degrees-->decimal value as suggested by stanav and paul.
The questions like this (i only calculate on paper but dont know how to implement in code):
Input user need to enter: -latitude local (e.g. 1.4875) -longitude local (e.g. 103.3883333)
My user requests to change the . on the numpad to a when entering text in a multiline textbox.So I was thinking about the KeyDown event.To determine if the numpad . was pressed I can do something like this [code]But now how do I change the returned charachter as a , ? All e.Key... properties are ReadOnly. The KeyPress events let me change this by providing e.KeyChar, but in that event I can't check for the numpad .
How would I go about rounding up decimal numbers to the nearest 2 decimal places? For example $7.0000032 would be $7.01 In theory, VB would make it $7.00 but if it is > $7.00, I want it to reflect that to the nearest penny... so $3.0000001 would be $3.01
I have writen the code so you put the number of times you want to flip the "coin" and into a label the results show. I want it to show the % instead of the number of times that the side lands on.
This is what I have so far:
Private Sub value(ByVal count As Integer, ByVal tailscount As Integer, ByVal headscount As Integer, ByVal flip As Integer) Dim FlipCount As Integer Dim strflip As String
Maybe this is just a really basic question that everyone knows the answer to, and is why I couldn't find the answer. What I want to do is pretty simple. I want to declare a custom type that's just like a Single, except when you access the value, you get the value rounded to the second or third decimal place. Something like this:
Dim MyNumer as TwoDecimalNumber MyNumer = 1.124 Msgbox(MyNumber) 'This would pop up a box showing "1.12"
Problem: Using the sub routing below, when adding a value to another value the results eventually change from 2-decimal places to multiple decimal places.Basically, the amount stored should always only be 2 decimal places, because the values passed in are always 2 decimal places. Output from calling the sub routine multiple times.
Running total = 329430.75 New Withheld Amount = 710.79 Running total = 330141.54
[code]....
As a workaround, I have a new routine that uses a custom round function to properly store only 2 decimal places - as the VB round function does not perform the type of rounding desired.I understand that we are removing the value from the dictionary and adding it back..
In window textbox, I'd like to just allow 2 decimal points only. I could set text box only numeric but don't know how to limit 2 decimal points.[code]...
I have a string which looks like this 512.3 is there a way to add a trailing zero so it looks like this 512.30 Just to clarify (sorry I didn't know there where different ways etc.) My string is an amount which is passed so changes all the time I only need the trailing zero on amounts like 512.3, 512.4,512.5 etc. as some of my amounts will pass values like 512.33 and 512.44 and so on