3

My codes,

 \documentclass{article}
 \usepackage{calculator}
 \usepackage{calculus}

 \newcommand\teo{3}
 \newcommand\job{,5}

 \begin{document}
 \MULTIPLY{\teo}{340}\W
 \MULTIPLY{\job}{5605}\WW
 \ADD{\W}{\WW}\credit
 \credit
 \end{document}

And result, 3822.5

Could it be, 3822,5?

I didn't find duplicate another question. I found like its, don't working in full my code. Does anyone know how to fix it?

1

You can use siunitx with it's \num macro and output-decimal-marker option:

\documentclass{article}
\usepackage{calculator}
\usepackage{calculus}
\usepackage{siunitx}     %% or make it global by \usepackage[output-decimal-marker = {,}]{siunitx}

  \newcommand\teo{3}
  \newcommand\job{,5}

\begin{document}
   \MULTIPLY{\teo}{340}\W
   \MULTIPLY{\job}{5605}\WW
   \ADD{\W}{\WW}\credit
   \credit

   \num[output-decimal-marker = {,}]{\credit}

   \ROUND[4]{\credit}{\credit}

   \num[output-decimal-marker = {,}]{\credit}
\end{document}

enter image description here

There are lot of options that \num macro can take. For details, refer siunitx manual.

  • Good working, like added picture. But dot is lost, 3 . 822,500. I don't find in its package about thousand separator. @Harish Kumar – Özgür Oct 21 '14 at 6:24
  • @Özgür You want dot as thousand separator? Are you sure? – user11232 Oct 21 '14 at 6:27
  • @Özgür \num[group-minimum-digits =3, group-separator = {.},output-decimal-marker = {,}]{\credit}. But no warranty! – user11232 Oct 21 '14 at 6:31
  • /@Harish Kumar/ Yes, I want dot as only thousand separator (no after comma). Your code is result, #.###,###.# (indeed no warrant :)). As a matter of fact, you answered according my question, opened this subject. The subject is closed. – Özgür Oct 21 '14 at 7:33
6

This is not related to calculator and calculus packages. There are several utilities to print decimal numbers with comma as decimal separator. Try, for example, the numprint package:

\documentclass{article}
\usepackage{calculator}
\usepackage{calculus}
\usepackage{numprint}

  \newcommand\teo{3}
  \newcommand\job{,5}

\begin{document}
   \MULTIPLY{\teo}{340}\W
   \MULTIPLY{\job}{5605}\WW
   \ADD{\W}{\WW}\credit
   \numprint{\credit}
\end{document} 
  • I am trying, @Robert Fuster. – Özgür Oct 20 '14 at 19:05
  • Add \ROUND[4]{\credit}{\credit} **\ADD{\W}{\WW}\credit between \numprint{\credit} result 3.822,500.0 . I'm not making to 3.822,5000 . – Özgür Oct 20 '14 at 19:48
  • It's good that I learnt calculator and calculus packages, @Robert Fuster. – Özgür Oct 21 '14 at 5:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.