MATLAB: Modifying/​rounding/a​proximatin​g a number

MATLABround/modify

i need a way to modify a number a=2.65987 into 2.6598 i tried round /fprintf , but both display as 2.6599 ,i need it badly ,i could just pop it out of nowhere by substracting 0.00007 but that's not helping .

Best Answer

One option:
c = floor(a*1E4)/1E4
producing:
c =
2.6598
.