sprintf and minus sign problem
Ältere Kommentare anzeigen
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?
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Code Performance finden Sie in Hilfe-Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!