MMEX Desktop v1.3.4.rc.2 is ready ... 1.3.4-rc.2

Currency formating

Build and share your cool customized reports built w/ one sql, Chart.js and Lua (
Post Reply
MMEX Developer
Posts: 1176
Joined: Sat Dec 06, 2008 2:27 pm
Are you a spam bot?: No
Location: Sankt-Petersburg, Russia

Currency formating

Post by Nikolay »

Currency formating

Code: Select all

<td class="money" style="text-align:right"><TMPL_VAR xxxxxx></td>

<script type="text/javascript">
  function currency(n) {n = parseFloat(n); return isNaN(n) ? 0 : n.toFixed(2);}
  var elements= document.getElementsByClassName("money");
  for (var i = 0; i < elements.length; i++) {elements[i].innerHTML = currency(elements[i].innerHTML);}

Post Reply