0
$\begingroup$

For aesthetic reasons I want to remove the decimal point when I use the function N. For example when put in N[30] I get out 30. when I just want 30 without the decimal point. Is it possible to remove the decimal point when it is not in need?

$\endgroup$
5
  • 1
    $\begingroup$ Look at Round[]. $\endgroup$
    – bill s
    Commented Oct 25, 2017 at 19:28
  • $\begingroup$ Thanks, that solved it in this case :) $\endgroup$ Commented Oct 25, 2017 at 19:37
  • 1
    $\begingroup$ What's the point of having no point in floating point numbers? Note that with Round you get also 30 from Round[N[29.999]], $\endgroup$ Commented Oct 25, 2017 at 19:38
  • $\begingroup$ Or use n = 30.; IntegerPart[n] gives 30 and the decimal is gone. Magic. $\endgroup$
    – Nasser
    Commented Oct 25, 2017 at 19:45
  • 1
    $\begingroup$ Why do you want to use N anyway? Why not just write 30? $\endgroup$
    – m_goldberg
    Commented Oct 25, 2017 at 23:39

0

Browse other questions tagged or ask your own question.