Комментарии:
Hey,
I noticed you didn't include details of Casting VS Converting VS Parsing in your UDEMY master class course. I think it's an important video, so pls add it to the course
Thanks for sharing! I have a list of strings, I need to convert some of those values to Decimals, I have a class called "Promedio" with some values that are type decimal. I'm writing th following code:
List<string> values (this is the list with all the string values, they come from several inputs form the user)
then im using my class "Promedio" to create a new object and trying to set the values of the List to the fields of my class, like this:
Promedios promedio = new()
{
C1 = Convert.ToDecimal(values[0]),
C2 = Convert.ToDecimal(values[1]),
Leaf = Convert.ToDecimal(values[2]),
Stpl = Convert.ToDecimal(values[3]),
Mic = Convert.ToDecimal(values[4])
}
but instead of returning decimal values, it returns items like this:
values[0] = "1.2367"
and C1 ends up being: 12376
I tried several solutions but I dont know what else to do, please help
Great. Many thanks
ОтветитьNice
Just boosting algorithm
very helpful and also i liked try and catch :) many thanks
Ответитьbut WHY are they different though?
Ответитьthank you alot!
Ответитьvery useful, thanks!
ОтветитьUseful!
ОтветитьAlways interesting as usual... But what happened to your voice???? Where is the Castafiore??? ;)
ОтветитьHow to create a desktop clock(widget) in C# for window 10? Can you make a tutorial on that please?
Ответить