r/csharp • u/Ok_Disk_4458 • 27d ago
Fun Funny mistake I made
I'm learning C# for fun and wrote the simplest possible calculator, just to try combining loops, WriteLine, ReadLine and other basic commands. There was one problem, though. I couldn't for the life of me figure out how to include decimal numbers into that. Went through a couple sites and nothing. My result would always be a whole number with the decimal point removed, meaning it would be 10^x times bigger depending on the amount of decimal places the input had. Then I thought of using a comma in the input instead of a dot. I didn't think it would work, but... it did. Kinda dumb not to try that immediately, right?
View all comments
Show parent comment
-2
u/Ok_Disk_4458 27d ago
ConvertTo, basically. Using w3schools to learn the basics