Number display format

  • Follow


Hello!

Format "short" displays 4 digits after a decimation point.  Is there any way to display 2 digits?

Thanks in advance for answers!
0
Reply Ilya 6/23/2010 9:59:05 AM

"Ilya " <mansmart@list.ru> wrote in message <hvslt9$dop$1@fred.mathworks.com>...
> Hello!
> 
> Format "short" displays 4 digits after a decimation point.  Is there any way to display 2 digits?
> 
> Thanks in advance for answers!

a hint:

     help sprintf;

us
0
Reply us 6/23/2010 10:20:05 AM


"Ilya " <mansmart@list.ru> wrote in message 
news:hvslt9$dop$1@fred.mathworks.com...
> Hello!
>
> Format "short" displays 4 digits after a decimation point.  Is there any 
> way to display 2 digits?
>
> Thanks in advance for answers!

FORMAT BANK

-- 
Steve Lord
slord@mathworks.com
comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ
To contact Technical Support use the Contact Us link on 
http://www.mathworks.com 


0
Reply slord (13358) 6/23/2010 1:25:37 PM

Ilya wrote:

> Format "short" displays 4 digits after a decimation point.  Is there any 
> way to display 2 digits?

Not without overriding the display() routine and having it format in 
whatever format you want. It is non-trivial coding as it has to take 
into account formatting for nested structures and such, and I wouldn't 
recommend tackling it. The other poster's suggestion to use sprintf is 
likely to be much more useful.
0
Reply Walter 6/23/2010 1:26:30 PM

3 Replies
260 Views

(page loaded in 0.049 seconds)

Similiar Articles:













7/7/2012 10:23:05 AM


Reply: