Just wanted to say thanks Sam for all of these awesome tutorials.
@DigitalMonsters11 жыл бұрын
Blitzing through these ^^ will have 200 done in a few days at this pace
@HikikomoriDev11 жыл бұрын
The Easy tutorials allow people who have no idea what the computing world may be are just getting out of the shell for the first time. You could always try more stuff like extreme Java and complex databases. but please always remember there will be people who have no idea where they are going, and this is their solution. there is also solutions for you, please search advanced programming.
@ImperialPlanet10 жыл бұрын
It actually rounds the decimals in the number you have stated.
@23Drezzy12 жыл бұрын
Thank you. I was just about to ask if it rounds off OR truncates values.
@chanwookim826311 жыл бұрын
Excellent tutorial once again. Keep up the good work
@Jbergawane96 жыл бұрын
Thank you so much, but what is the difference between rounding and string formating ?
@jasonmesa42247 жыл бұрын
I can't get (String.Format("{0:n2}", myDouble)) to work in VB 2015 using buttons or other referenced portions. Cant use console.writeline for everything...
@robertmccully27927 жыл бұрын
Here are there variations using window forms. They all work vb 2010 2015 is a memory hog... Dim dblNumber As Double dblNumber = 12.123456789 dblNumber /= 7 MessageBox.Show(String.Format("{0:n2}", dblNumber) & "HI..", "hello") MessageBox.Show(String.Format("Test..." & "{0:n9}", dblNumber), "Floating Numbers") MessageBox.Show("test.." & String.Format("{0:n5}", dblNumber)) Close()
@thishitscustom33313 жыл бұрын
@onlivegamer For Console.WriteLine(String.Format("{0:n2}", myDouble))....... How can you format a string (which are letters) with {0:n2}? I understand what {0,n2} does but if you want to format a number shouldn't the statement be (myDouble.Format("{0:n2}", myDouble)) ? If myDouble is as double, why do you write String? Thanks
@arsenalprince412 жыл бұрын
@bomer890 I don't know if this is a late reply and I am still a beginner. What I suppose the String.format does is not to alter the number's format, but only display it as a string which has the format{0:n2}, myDouble is unchanged.
@TDawg-de8sb8 жыл бұрын
its so funny looked at vb a week ago expecting it to be really hard its not that complicated because all the syntax and stuff are easy to pick up on I love vb
@greatbucket8512 жыл бұрын
Hi Sam, please assist me with line number 9. I have followed it to the detail and didn't receive anything on the error list. however once I start debugging. an error exception occurs.
@bradmillington55694 жыл бұрын
Any chance you remember how you fixed this 7 years on? 😅
@TheVerbalAxiom10 жыл бұрын
2nd day of Vb.net, Time for my 22nd tutorial, on top of already creating side projects. #GettingStronger
@bomer89013 жыл бұрын
Hey..i'm not really know about the .format('{0.n2}'; myDouble).... can somebody explan to me...??
@DailyFrankPeter10 жыл бұрын
I get an InvalidCastException in line 7
@muazabdool604710 жыл бұрын
Probably because of you used . instead of , i know its annoying :) also had the same problem
@newhuman94589 жыл бұрын
تحية لكل عربي لم يفهم ههههههههه
@23Drezzy12 жыл бұрын
I might be late but once you type "String." it uses the string class in .NET to convert the values given to string format. I am not 100% sure though.
@harishli202012 жыл бұрын
I have exactly done what you have shown, but when I type 2142.2342, I'm getting 21.422.342,00.
@RahilWazirAli12 жыл бұрын
No!!! In the 19th tutorial he didn't forget :D
@spyroglitcher13 жыл бұрын
@deenotheman2 thats right.
@VijayNandwani13 жыл бұрын
You didn't explain what is the use and function of String.Format("{0:n2}"
@FonteneleNXT12 жыл бұрын
I think it coud be useful for a calculator program.
@Blackllama1313 жыл бұрын
Keep in mind, it rounds to the first .2 deciaml points. so if I did 15.666 i'd come out as 15.67
@greatbucket8511 жыл бұрын
Right, anyway I figured it out. Thanks
@mattablack238 жыл бұрын
This is me being late to the game but this uses what we have learned from a few previous lessons up to now.. Module Module1 'rapping up from tutorial 19 to 21... Tutorials by Sam AKA TheNewBoston.. AKA OnliveGamer.. Sub Main() Dim myString As String = Nothing Dim dValue As Double = Nothing Console.WriteLine("Please enter a set of letters or a word that equals up to 5 characters or more.") myString = Console.ReadLine() If myString.Length >= 5 Then 'I sat here for like 10 minutes wondering why mystring.length.Equals(5) did not work when I 'typed because I never typed exactly five letters.. Console.WriteLine("Please enter a decimal value") dValue = Console.ReadLine() Console.Clear() Console.WriteLine(String.Format("{0:n2}", dValue)) Console.WriteLine(myString.ToUpper()) Console.WriteLine(myString.ToLower()) Console.ReadLine() Console.WriteLine(myString.Substring(0, 1)) Console.WriteLine(myString.Substring(0, 2)) Console.WriteLine(myString.Substring(0, 3)) Console.WriteLine(myString.Substring(0, 4)) Console.WriteLine(myString.Substring(0, 4)) Console.WriteLine(myString.Substring(0, 3)) Console.WriteLine(myString.Substring(0, 2)) Console.WriteLine(myString.Substring(0, 1)) Console.WriteLine(myString.Substring(0)) Console.ReadLine() Else Console.Clear() Console.WriteLine("The string must be at least 5 letters long.") Console.ReadLine() End If End Sub End Module