adplus-dvertising
frame-decoration

Question

Why isn’t the answer 10.230?
>> sprintf("%1.3d", 10.23)
 ans = 
       "1.023e+01"

a.

We’ve used %d

b.

We’ve used “”

c.

Character arrays are like this

d.

Undefined answer

Posted under MATLAB

Answer: (a).We’ve used %d

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. Why isn’t the answer 10.230?