Click here to Skip to main content
15,881,381 members
Home / Discussions / C#
   

C#

 
GeneralRe: Error when importing a class dll Pin
Richard Andrew x644-Aug-21 7:29
professionalRichard Andrew x644-Aug-21 7:29 
GeneralRe: Error when importing a class dll Pin
Richard MacCutchan4-Aug-21 7:32
mveRichard MacCutchan4-Aug-21 7:32 
GeneralRe: Error when importing a class dll Pin
Bohdan Stupak6-Aug-21 5:06
professionalBohdan Stupak6-Aug-21 5:06 
AnswerRe: Error when importing a class dll Pin
BillWoodruff8-Aug-21 20:30
professionalBillWoodruff8-Aug-21 20:30 
SuggestionRe: Error when importing a class dll Pin
Richard Deeming8-Aug-21 21:20
mveRichard Deeming8-Aug-21 21:20 
GeneralRe: Error when importing a class dll Pin
BillWoodruff8-Aug-21 23:28
professionalBillWoodruff8-Aug-21 23:28 
QuestionFloating point conversion with error Pin
Ismael Oliveira 20211-Aug-21 13:14
Ismael Oliveira 20211-Aug-21 13:14 
AnswerRe: Floating point conversion with error Pin
OriginalGriff1-Aug-21 19:12
mveOriginalGriff1-Aug-21 19:12 
Why are you converting something to a string in order to parse it to a float?
Either it's a string to start with - in which case it's a waste of time and looks like the coder didn't know what he was doing - or it is a numeric value already - in which case why are you trying to parse it at all?

If I try to abstract your code:
C#
float tb = 0.0F;
tb += float.Parse("666.66") / 100;
Console.WriteLine(tb);
Then I get what I expected: 6.6666 so there are a couple of possibilities:
1) LinhaSaldo[i].ItemArray[2] is not the value you expect it to be.
2) TotalBancos is not a floating point variable.
We can't check either of those so, it's going to be up to you.
Fortunately, you have a tool available to you which will help you find out what is going on: the debugger. If you don't know how to use it then a quick Google for "Visual Studio debugger" should give you the info you need.

Put a breakpoint on the first line in the function, and run your code through the debugger. Then look at your code, and at your data and work out what should happen manually. Then single step each line checking that what you expected to happen is exactly what did. When it isn't, that's when you have a problem, and you can back-track (or run it again and look more closely) to find out why.

Sorry, but we can't do that for you - time for you to learn a new (and very, very useful) skill: debugging!
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!

GeneralRe: Floating point conversion with error Pin
Ismael Oliveira 20212-Aug-21 15:45
Ismael Oliveira 20212-Aug-21 15:45 
AnswerRe: Floating point conversion with error Pin
Richard MacCutchan1-Aug-21 21:51
mveRichard MacCutchan1-Aug-21 21:51 
GeneralRe: Floating point conversion with error Pin
Ismael Oliveira 20212-Aug-21 15:59
Ismael Oliveira 20212-Aug-21 15:59 
AnswerRe: Floating point conversion with error Pin
jsc422-Aug-21 1:21
professionaljsc422-Aug-21 1:21 
GeneralRe: Floating point conversion with error Pin
Ismael Oliveira 20212-Aug-21 15:58
Ismael Oliveira 20212-Aug-21 15:58 
QuestionMake a control invisible Pin
Ismael Oliveira 202131-Jul-21 14:56
Ismael Oliveira 202131-Jul-21 14:56 
AnswerRe: Make a control invisible Pin
Gerry Schmitz31-Jul-21 17:03
mveGerry Schmitz31-Jul-21 17:03 
AnswerRe: Make a control invisible Pin
OriginalGriff31-Jul-21 19:19
mveOriginalGriff31-Jul-21 19:19 
GeneralRe: Make a control invisible Pin
Ismael Oliveira 20211-Aug-21 12:57
Ismael Oliveira 20211-Aug-21 12:57 
AnswerRe: Make a control invisible Pin
Mycroft Holmes1-Aug-21 12:17
professionalMycroft Holmes1-Aug-21 12:17 
GeneralRe: Make a control invisible Pin
Gerry Schmitz2-Aug-21 7:45
mveGerry Schmitz2-Aug-21 7:45 
GeneralRe: Make a control invisible Pin
Mycroft Holmes2-Aug-21 13:52
professionalMycroft Holmes2-Aug-21 13:52 
GeneralRe: Make a control invisible Pin
BillWoodruff20-Aug-21 6:50
professionalBillWoodruff20-Aug-21 6:50 
QuestionError handling when using Invoke method Pin
Alex Dunlop31-Jul-21 5:49
Alex Dunlop31-Jul-21 5:49 
AnswerRe: Error handling when using Invoke method Pin
Richard MacCutchan31-Jul-21 21:04
mveRichard MacCutchan31-Jul-21 21:04 
QuestionHow to pass a variable inside Try{} to outside of it? Pin
Alex Dunlop30-Jul-21 23:05
Alex Dunlop30-Jul-21 23:05 
AnswerRe: How to pass a variable inside Try{} to outside of it? Pin
OriginalGriff30-Jul-21 23:27
mveOriginalGriff30-Jul-21 23:27 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.