The value stored in val is equal to 123456.125. You are getting .13 because you are rounding it:
float val = 123456.123456;
printf("%.4f %.2f\n", val, val);
output: 123456.1250 123456.13
You should use double in this case to avoid truncation. Also compilerCompiler should also warn you when you doing this: "warning C4305: 'initializing' : truncation from 'double' to 'float'".