ran into a problem comparing a value less than zero to zero
// tax could be entered as 6.625 or .06625
decimal tax = .06625m;
if (tax < 0.0m)
{
tax = tax * 100;
}
Console.WriteLine("tax rate is: {0}", tax);
Output is: tax rate is: 0.06625
Expected : tax rate is: 6.625
New contributor
Joseph Scavitto is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
2