Hi everyone!
I am summing double values but I want to file_out the sumpayments without the decimal but still keep the reminding value of the decimal so for example:
23.07 becomes 2307
17.96 becomes 1796
In this case sumRN is 1888.11 but I want it displayed as 188811
I love how your code snip is incredible useless.
¿what part should I look at?
`sumRN' appears only one single time, and with "test" before, so going to ignore it.
the other output is just "to make sure", so ignoring that too.
> 23.07 becomes 2307
mutiply by 100 and take the integer.
> while (!file_in.eof())
I hope that you end up reading the last line twice.
if they are all 2 digits X 100 works. If they are not, convert the double to a string, cap the period, and convert back is a crude but simple and effective way to do it. if they are not all the same order, comparison or addition etc won't give meaningful results.
ne555, I love that you love that too!! Sorry, but this is the beginners forum and my first post so how about pointing the error out without the sarcastic undertone.
I am aware that it will read the last line twice but my professor wants us to learn this command.
Thanks for the answers. It was as simple as multiplying it by a 100, haha :)