sprintf and minus sign problem
이전 댓글 표시
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?
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Code Performance에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!