sprintf and minus sign problem
Show older comments
I have a problem understanding the sprintf function in a specific case:
sprintf('%.2f', 0)
produces: "0.00" , as expected.
In my case I have a variable [value] that should equal 0:
value == 0
ans = 1
but
sprintf(%.2f, value)
results in "-0.00" (a minus sign is added)
Is there any chance that [value] still contains something different from 0, eventhough value == 0 retuns TRUE?
Accepted Answer
More Answers (0)
Categories
Find more on Code Performance in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!