# Revision history [back]

### Recognizing float numbers

Hello. I have function, which shows a FLOAT number with comma instead of dot. But if i use this function on INT number it shows FLOAT number. Here is the function

\begin{sage.} def numprint(x): x = round(x, ndigits=3) x = latex(x) x = str(x) x = x.replace('.', ',!').replace('\times','\, \ldotp') x = sage.misc.latex.LatexExpr(x) return x \end{sage} \newcommand{\sagedot}{\sagestr{numprint(RDF(#1))}}

So, when i use \sagedot{3} it shows 3.0 instead of 3. Help me to improve it. Thanks and sorry for dumb english and question :D

### Recognizing float numbers

Hello. I have function, which shows a FLOAT number with comma instead of dot. But if i use this function on INT number it shows FLOAT number. Here is the function

\begin{sage.} \begin{sagesilent.} def numprint(x): x = round(x, ndigits=3) x = latex(x) x = str(x) x = x.replace('.', ',!').replace('\times','\, \ldotp') x = sage.misc.latex.LatexExpr(x) return x \end{sage} \newcommand{\sagedot}{\sagestr{numprint(RDF(#1))}}

So, when i use \sagedot{3} it shows 3.0 instead of 3. Help me to improve it. Thanks and sorry for dumb english and question :D 3 Markdown code.

### Recognizing float numbers

Hello. I have function, which shows a FLOAT number with comma instead of dot. But if i use this function on INT number it shows FLOAT number. Here is the function

\begin{sagesilent.}
def numprint(x):
x = round(x, ndigits=3)
x = latex(x)
x = str(x)
x = x.replace('.', ',!').replace('\times','\, ',\!').replace('\\times','\, \ldotp')
x = sage.misc.latex.LatexExpr(x)
return x
\end{sage}
\newcommand{\sagedot}{\sagestr{numprint(RDF(#1))}}\newcommand{\sagedot}{\sagestr{numprint(RDF(#1))}}


So, when i use \sagedot{3} \sagedot{3} it shows 3.0 instead of 3. Help me to improve it. Thanks and sorry for dumb english and question :D

### Recognizing float numbers

Hello. I have function, which shows a FLOAT number with comma instead of dot. But if i use this function on INT number it shows FLOAT number. Here is the function

\begin{sagesilent.}
\begin{sagesilent}
def numprint(x):
x = round(x, ndigits=3)
x = latex(x)
x = str(x)
x = x.replace('.', ',\!').replace('\\times','\, \ldotp')
x = sage.misc.latex.LatexExpr(x)
return x
\end{sage}
\newcommand{\sagedot}{\sagestr{numprint(RDF(#1))}}


So, when i use \sagedot{3} it shows 3.0 instead of 3. Help me to improve it. Thanks and sorry for dumb english and question :D

### Recognizing Cutting unnecessary zeroes in float numbers

Hello. I have function, which shows a FLOAT float number with comma instead of dot. But if i use this function on INT number integer it shows FLOAT float number. Here is the function

\begin{sagesilent}
def numprint(x):
x = round(x, ndigits=3)
x = latex(x)
x = str(x)
x = x.replace('.', ',\!').replace('\\times','\, \ldotp')
x = sage.misc.latex.LatexExpr(x)
return x
\end{sage}
\newcommand{\sagedot}{\sagestr{numprint(RDF(#1))}}


So, when i use \sagedot{3} it shows 3.0 instead of 3. Help me to improve it. Thanks and sorry for dumb english and question :D