<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/165071</link>
    <title>MATLAB Central Newsreader - how to round to 2 decimal?</title>
    <description>Feed for thread: how to round to 2 decimal?</description>
    <language>en-us</language>
    <copyright>&amp;copy;1994-2008 by The MathWorks, Inc.</copyright>
    <webmaster>webmaster@mathworks.com</webmaster>
    <generator>MATLAB Central Newsreader</generator>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <ttl>60</ttl>
    <image>
      <title>The MathWorks</title>
      <url>http://www.mathworks.com/images/membrane_icon.gif</url>
    </image>
    <item>
      <pubDate>Tue, 04 Mar 2008 15:26:02 -0500</pubDate>
      <title>how to round to 2 decimal?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/165071#418944</link>
      <author>Deo </author>
      <description>hey, how can I set my matlab program to round all the &lt;br&gt;
double numbers to 2 decimals&lt;br&gt;
</description>
    </item>
    <item>
      <pubDate>Tue, 04 Mar 2008 23:51:03 -0500</pubDate>
      <title>Re: how to round to 2 decimal?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/165071#419067</link>
      <author>Dan Haeg</author>
      <description>"Deo " &amp;lt;spliers@hotmail.com&amp;gt; wrote in message&lt;br&gt;
&amp;lt;fqjpma$66c$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; hey, how can I set my matlab program to round all the &lt;br&gt;
&amp;gt; double numbers to 2 decimals&lt;br&gt;
&lt;br&gt;
here is one way:&lt;br&gt;
&lt;br&gt;
data=round(data*100)/100&lt;br&gt;
&lt;br&gt;
rounding functions in matlab:&lt;br&gt;
&lt;br&gt;
round&lt;br&gt;
fix&lt;br&gt;
floor&lt;br&gt;
ceil&lt;br&gt;
&lt;br&gt;
look in the help for more information.&lt;br&gt;
</description>
    </item>
    <item>
      <pubDate>Wed, 05 Mar 2008 00:26:27 -0500</pubDate>
      <title>Re: how to round to 2 decimal?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/165071#419071</link>
      <author>roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)</author>
      <description>In article &amp;lt;fqkn97$hnn$1@fred.mathworks.com&amp;gt;, Dan Haeg &amp;lt;haegd@msoe.edu&amp;gt; wrote:&lt;br&gt;
&amp;gt;"Deo " &amp;lt;spliers@hotmail.com&amp;gt; wrote in message&lt;br&gt;
&amp;gt;&amp;lt;fqjpma$66c$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt;&amp;gt; hey, how can I set my matlab program to round all the &lt;br&gt;
&amp;gt;&amp;gt; double numbers to 2 decimals&lt;br&gt;
&lt;br&gt;
&amp;gt;here is one way:&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt;data=round(data*100)/100&lt;br&gt;
&lt;br&gt;
&amp;gt;&amp;gt; data=pi; data=round(data*100)/100; sprintf('%.60g', data)&lt;br&gt;
&lt;br&gt;
ans =&lt;br&gt;
&lt;br&gt;
3.140000000000000124344978758017532527446746826171875&lt;br&gt;
&lt;br&gt;
Why didn't I get 3.14 exactly? I followed your steps word for word!&lt;br&gt;
Is sprintf broken???&lt;br&gt;
-- &lt;br&gt;
&amp;nbsp;&amp;nbsp;"All human knowledge takes the form of interpretation."&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;-- Walter Benjamin&lt;br&gt;
</description>
    </item>
    <item>
      <pubDate>Wed, 05 Mar 2008 08:28:01 -0500</pubDate>
      <title>Re: how to round to 2 decimal?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/165071#419112</link>
      <author>nor ki</author>
      <description>roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson) wrote in&lt;br&gt;
message &amp;lt;fqkpbj$72h$1@canopus.cc.umanitoba.ca&amp;gt;...&lt;br&gt;
&amp;gt; In article &amp;lt;fqkn97$hnn$1@fred.mathworks.com&amp;gt;, Dan Haeg&lt;br&gt;
&amp;lt;haegd@msoe.edu&amp;gt; wrote:&lt;br&gt;
&amp;gt; &amp;gt;"Deo " &amp;lt;spliers@hotmail.com&amp;gt; wrote in message&lt;br&gt;
&amp;gt; &amp;gt;&amp;lt;fqjpma$66c$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; hey, how can I set my matlab program to round all the &lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; double numbers to 2 decimals&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &amp;gt;here is one way:&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt;data=round(data*100)/100&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; data=pi; data=round(data*100)/100; sprintf('%.60g', data)&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; ans =&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; 3.140000000000000124344978758017532527446746826171875&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Why didn't I get 3.14 exactly? I followed your steps word&lt;br&gt;
for word!&lt;br&gt;
&amp;gt; Is sprintf broken???&lt;br&gt;
&amp;gt; -- &lt;br&gt;
&amp;gt;   "All human knowledge takes the form of interpretation."&lt;br&gt;
&amp;gt;                                               -- Walter&lt;br&gt;
Benjamin&lt;br&gt;
&lt;br&gt;
Hi Benjamin,&lt;br&gt;
&lt;br&gt;
no sprintf is fine the problem occurs by /100. as 100 is no&lt;br&gt;
power of 2 rounding errors occur&lt;br&gt;
this will always occur when you divide.&lt;br&gt;
&lt;br&gt;
for an exact rounding try &lt;br&gt;
str2num(sprintf('%5.2f',pi))&lt;br&gt;
which looks strange to me but seems to work&lt;br&gt;
&lt;br&gt;
kinor&lt;br&gt;
</description>
    </item>
    <item>
      <pubDate>Wed, 05 Mar 2008 09:58:02 -0500</pubDate>
      <title>Re: how to round to 2 decimal?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/165071#419119</link>
      <author>us</author>
      <description>"nor ki":&lt;br&gt;
&amp;lt;SNIP more on FP-trash...&lt;br&gt;
&lt;br&gt;
&amp;gt; for an exact rounding try &lt;br&gt;
&amp;gt; str2num(sprintf('%5.2f',pi))&lt;br&gt;
&amp;gt; which looks strange to me but seems to work...&lt;br&gt;
&lt;br&gt;
does it?&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;format long;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;r=str2num(sprintf('%5.2f',pi))&lt;br&gt;
% r =&lt;br&gt;
%     3.140000000000000&lt;br&gt;
% however,&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;s=sprintf('%.20f\n',r,3.14)&lt;br&gt;
% s = &lt;br&gt;
%     3.14000000000000010000 % &amp;lt;- result&lt;br&gt;
%     3.14000000000000010000 % &amp;lt;- hand coded&lt;br&gt;
&lt;br&gt;
us&lt;br&gt;
</description>
    </item>
    <item>
      <pubDate>Wed, 05 Mar 2008 17:36:28 -0500</pubDate>
      <title>Re: how to round to 2 decimal?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/165071#419210</link>
      <author>roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)</author>
      <description>In article &amp;lt;fqllih$doa$1@fred.mathworks.com&amp;gt;,&lt;br&gt;
nor ki &amp;lt;kinor.removeme@gmx.de&amp;gt; wrote:&lt;br&gt;
&amp;gt;roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson) wrote in&lt;br&gt;
&amp;gt;message &amp;lt;fqkpbj$72h$1@canopus.cc.umanitoba.ca&amp;gt;...&lt;br&gt;
&amp;gt;&amp;gt; In article &amp;lt;fqkn97$hnn$1@fred.mathworks.com&amp;gt;, Dan Haeg&lt;br&gt;
&amp;gt;&amp;lt;haegd@msoe.edu&amp;gt; wrote:&lt;br&gt;
&amp;gt;&amp;gt; &amp;gt;"Deo " &amp;lt;spliers@hotmail.com&amp;gt; wrote in message&lt;br&gt;
&amp;gt;&amp;gt; &amp;gt;&amp;lt;fqjpma$66c$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt;&amp;gt; &amp;gt;&amp;gt; hey, how can I set my matlab program to round all the &lt;br&gt;
&amp;gt;&amp;gt; &amp;gt;&amp;gt; double numbers to 2 decimals&lt;br&gt;
&lt;br&gt;
&amp;gt;&amp;gt; &amp;gt;here is one way:&lt;br&gt;
&lt;br&gt;
&amp;gt;&amp;gt; &amp;gt;data=round(data*100)/100&lt;br&gt;
&lt;br&gt;
&amp;gt;&amp;gt; &amp;gt;&amp;gt; data=pi; data=round(data*100)/100; sprintf('%.60g', data)&lt;br&gt;
&lt;br&gt;
&amp;gt;&amp;gt; ans =&lt;br&gt;
&lt;br&gt;
&amp;gt;&amp;gt; 3.140000000000000124344978758017532527446746826171875&lt;br&gt;
&lt;br&gt;
&amp;gt;&amp;gt; Why didn't I get 3.14 exactly? I followed your steps word&lt;br&gt;
&amp;gt;for word!&lt;br&gt;
&amp;gt;&amp;gt; Is sprintf broken???&lt;br&gt;
&lt;br&gt;
&amp;gt;no sprintf is fine the problem occurs by /100. as 100 is no&lt;br&gt;
&amp;gt;power of 2 rounding errors occur&lt;br&gt;
&lt;br&gt;
But Dan said that his way worked! Are you saying that he was WRONG?&lt;br&gt;
&lt;br&gt;
&amp;gt;this will always occur when you divide.&lt;br&gt;
&lt;br&gt;
&amp;gt;&amp;gt; data=3.25;data=round(data*100)/100; sprintf('%.60g', data)&lt;br&gt;
&lt;br&gt;
ans =&lt;br&gt;
&lt;br&gt;
3.25&lt;br&gt;
&lt;br&gt;
Where did the round-off error in Dan's routine go? I can't find it?&lt;br&gt;
Do I need a wider format than %.60g to see it??&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&amp;gt;for an exact rounding try &lt;br&gt;
&amp;gt;str2num(sprintf('%5.2f',pi))&lt;br&gt;
&amp;gt;which looks strange to me but seems to work&lt;br&gt;
&lt;br&gt;
&amp;gt;&amp;gt; data=str2num(sprintf('%5.2f',pi)); sprintf('%.60g', data)&lt;br&gt;
&lt;br&gt;
ans =&lt;br&gt;
&lt;br&gt;
3.140000000000000124344978758017532527446746826171875&lt;br&gt;
&lt;br&gt;
Why didn't I get 3.14 exactly? I followed your steps word for&lt;br&gt;
word! Is sprintf broken???&lt;br&gt;
&lt;br&gt;
-- &lt;br&gt;
&amp;nbsp;&amp;nbsp;"Do diddle di do,&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;Poor Jim Jay&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;Got stuck fast&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;In Yesterday."                             -- Walter De La Mare&lt;br&gt;
</description>
    </item>
    <item>
      <pubDate>Wed, 05 Mar 2008 23:30:18 -0500</pubDate>
      <title>Re: how to round to 2 decimal?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/165071#419274</link>
      <author>carlos lopez</author>
      <description>"Deo " &amp;lt;spliers@hotmail.com&amp;gt; wrote in message&lt;br&gt;
&amp;lt;fqjpma$66c$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; hey, how can I set my matlab program to round all the &lt;br&gt;
&amp;gt; double numbers to 2 decimals&lt;br&gt;
Hello Deo:&lt;br&gt;
Aside from the other answers, I believe that you should&lt;br&gt;
clearly state which one is your real wish:&lt;br&gt;
a) perform every calculation in fixed point, using only two&lt;br&gt;
decimals&lt;br&gt;
b) display every final result as a real with just two decimals.&lt;br&gt;
The other answers are related with the option b), but they&lt;br&gt;
do not preclude that all the calculations will be carried&lt;br&gt;
out to full double precision, and only later displayed as&lt;br&gt;
you wish.&lt;br&gt;
On the other hand, if you need something as described in a),&lt;br&gt;
you should consider other approaches. To some extent, two&lt;br&gt;
decimal arithmetic can be simulated with integer arithmetic&lt;br&gt;
after multiplying the inputs by 100. Depending on your&lt;br&gt;
matlab version, it will be simpler (or not) to achieve that.&lt;br&gt;
Let us know about your option: namely a) or b)&lt;br&gt;
Regards&lt;br&gt;
Carlos&lt;br&gt;
</description>
    </item>
    <item>
      <pubDate>Sat, 28 Jun 2008 22:09:01 -0400</pubDate>
      <title>Re: how to round to 2 decimal?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/165071#440080</link>
      <author>Omar U. Florez</author>
      <description>sprintf('%g',round(-sorted_values(j)*100)/100)&lt;br&gt;
&lt;br&gt;
where the specifier '%g' avoids showing the last &lt;br&gt;
or 'insignificant' zeros and shows only the two decimals &lt;br&gt;
product of multiplying by 100. &lt;br&gt;
&lt;br&gt;
&amp;gt;&amp;gt; sprintf('%g',round(pi*100)/100)&lt;br&gt;
&lt;br&gt;
ans =&lt;br&gt;
3.14&lt;br&gt;
&lt;br&gt;
"carlos lopez" &amp;lt;clv2clv_00000000_@adinet.com.uy&amp;gt; wrote in &lt;br&gt;
message &amp;lt;fqnaea$370$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; "Deo " &amp;lt;spliers@hotmail.com&amp;gt; wrote in message&lt;br&gt;
&amp;gt; &amp;lt;fqjpma$66c$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; hey, how can I set my matlab program to round all the &lt;br&gt;
&amp;gt; &amp;gt; double numbers to 2 decimals&lt;br&gt;
&amp;gt; Hello Deo:&lt;br&gt;
&amp;gt; Aside from the other answers, I believe that you should&lt;br&gt;
&amp;gt; clearly state which one is your real wish:&lt;br&gt;
&amp;gt; a) perform every calculation in fixed point, using only &lt;br&gt;
two&lt;br&gt;
&amp;gt; decimals&lt;br&gt;
&amp;gt; b) display every final result as a real with just two &lt;br&gt;
decimals.&lt;br&gt;
&amp;gt; The other answers are related with the option b), but they&lt;br&gt;
&amp;gt; do not preclude that all the calculations will be carried&lt;br&gt;
&amp;gt; out to full double precision, and only later displayed as&lt;br&gt;
&amp;gt; you wish.&lt;br&gt;
&amp;gt; On the other hand, if you need something as described in &lt;br&gt;
a),&lt;br&gt;
&amp;gt; you should consider other approaches. To some extent, two&lt;br&gt;
&amp;gt; decimal arithmetic can be simulated with integer &lt;br&gt;
arithmetic&lt;br&gt;
&amp;gt; after multiplying the inputs by 100. Depending on your&lt;br&gt;
&amp;gt; matlab version, it will be simpler (or not) to achieve &lt;br&gt;
that.&lt;br&gt;
&amp;gt; Let us know about your option: namely a) or b)&lt;br&gt;
&amp;gt; Regards&lt;br&gt;
&amp;gt; Carlos&lt;br&gt;
&lt;br&gt;
</description>
    </item>
    <item>
      <pubDate>Sat, 28 Jun 2008 22:18:35 -0400</pubDate>
      <title>Re: how to round to 2 decimal?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/165071#440081</link>
      <author>zia</author>
      <description>On Jun 28, 6:09=A0pm, "Omar U. Florez" &amp;lt;omarflore...@gmail.com&amp;gt; wrote:&lt;br&gt;
&amp;gt; sprintf('%g',round(-sorted_values(j)*100)/100)&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; where the specifier '%g' avoids showing the last&lt;br&gt;
&amp;gt; or 'insignificant' zeros and shows only the two decimals&lt;br&gt;
&amp;gt; product of multiplying by 100.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; sprintf('%g',round(pi*100)/100)&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; ans =3D&lt;br&gt;
&amp;gt; 3.14&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; "carlos lopez" &amp;lt;clv2clv_000000...@adinet.com.uy&amp;gt; wrote in&lt;br&gt;
&amp;gt; message &amp;lt;fqnaea$37...@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; "Deo " &amp;lt;spli...@hotmail.com&amp;gt; wrote in message&lt;br&gt;
&amp;gt; &amp;gt; &amp;lt;fqjpma$66...@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; hey, how can I set my matlab program to round all the&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; double numbers to 2 decimals&lt;br&gt;
&amp;gt; &amp;gt; Hello Deo:&lt;br&gt;
&amp;gt; &amp;gt; Aside from the other answers, I believe that you should&lt;br&gt;
&amp;gt; &amp;gt; clearly state which one is your real wish:&lt;br&gt;
&amp;gt; &amp;gt; a) perform every calculation in fixed point, using only&lt;br&gt;
&amp;gt; two&lt;br&gt;
&amp;gt; &amp;gt; decimals&lt;br&gt;
&amp;gt; &amp;gt; b) display every final result as a real with just two&lt;br&gt;
&amp;gt; decimals.&lt;br&gt;
&amp;gt; &amp;gt; The other answers are related with the option b), but they&lt;br&gt;
&amp;gt; &amp;gt; do not preclude that all the calculations will be carried&lt;br&gt;
&amp;gt; &amp;gt; out to full double precision, and only later displayed as&lt;br&gt;
&amp;gt; &amp;gt; you wish.&lt;br&gt;
&amp;gt; &amp;gt; On the other hand, if you need something as described in&lt;br&gt;
&amp;gt; a),&lt;br&gt;
&amp;gt; &amp;gt; you should consider other approaches. To some extent, two&lt;br&gt;
&amp;gt; &amp;gt; decimal arithmetic can be simulated with integer&lt;br&gt;
&amp;gt; arithmetic&lt;br&gt;
&amp;gt; &amp;gt; after multiplying the inputs by 100. Depending on your&lt;br&gt;
&amp;gt; &amp;gt; matlab version, it will be simpler (or not) to achieve&lt;br&gt;
&amp;gt; that.&lt;br&gt;
&amp;gt; &amp;gt; Let us know about your option: namely a) or b)&lt;br&gt;
&amp;gt; &amp;gt; Regards&lt;br&gt;
&amp;gt; &amp;gt; Carlos&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
Hello,&lt;br&gt;
&lt;br&gt;
Try this&lt;br&gt;
&lt;br&gt;
x =3D 1.23456&lt;br&gt;
&lt;br&gt;
quant(x,2)&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
function output =3D quant(number,digit)&lt;br&gt;
&lt;br&gt;
output =3D round(number.*(10 ^ digit))./(10 ^ digit);&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
--Zia&lt;br&gt;
</description>
    </item>
    <item>
      <pubDate>Sat, 28 Jun 2008 22:45:04 -0400</pubDate>
      <title>Re: how to round to 2 decimal?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/165071#440082</link>
      <author>us</author>
      <description>zia:&lt;br&gt;
&amp;lt;SNIP another solution - another world...&lt;br&gt;
&lt;br&gt;
&amp;gt; Try this&lt;br&gt;
&amp;gt; x =3D 1.23456&lt;br&gt;
&amp;gt; quant(x,2)&lt;br&gt;
&lt;br&gt;
you should tell the OP that your solution requires the &lt;br&gt;
neural network tbx...&lt;br&gt;
&lt;br&gt;
us&lt;br&gt;
</description>
    </item>
    <item>
      <pubDate>Sun, 29 Jun 2008 09:21:55 -0400</pubDate>
      <title>Re: how to round to 2 decimal?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/165071#440105</link>
      <author>Nasser Abbasi</author>
      <description>&lt;br&gt;
"us " &amp;lt;us@neurol.unizh.ch&amp;gt; wrote in message &lt;br&gt;
news:g46etg$pmu$1@fred.mathworks.com...&lt;br&gt;
&amp;gt; zia:&lt;br&gt;
&amp;gt; &amp;lt;SNIP another solution - another world...&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt;&amp;gt; Try this&lt;br&gt;
&amp;gt;&amp;gt; x =3D 1.23456&lt;br&gt;
&amp;gt;&amp;gt; quant(x,2)&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; you should tell the OP that your solution requires the&lt;br&gt;
&amp;gt; neural network tbx...&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; us&lt;br&gt;
&lt;br&gt;
humm.. he pasted the one line source code for quant().&lt;br&gt;
&lt;br&gt;
"function output = quant(number,digit)&lt;br&gt;
&lt;br&gt;
output = round(number.*(10 ^ digit))./(10 ^ digit);"&lt;br&gt;
&lt;br&gt;
So one can just copy it and use it. no need for neural netwrok toolbox?&lt;br&gt;
&lt;br&gt;
Nasser&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
</description>
    </item>
  </channel>
</rss>
