Your mistake is that you are doing integer math and then saving the result in a float.
float current = (516 - rawcurr) * 45 / 1023;
It's OK to do the subtract and multiply in integers but for the division, one of the two arguments has to be float to get a float result. Try this:
float current = (516 - rawcurr) * 45 / 1023.0;