Tag Archives: slikcalc

slikcalc 1.1 release

I’ve just released a new build of slikcalc – javascript calculator library that includes a few small bug fixes, and some shortcuts to the API. The new API for creating calculators looks as follows: as opposed to: Its a small change, but I think is easier to use. Of course the old way will still [...]

Also tagged | Leave a comment

slickifying Slikcalc to version 1.0

A new version of Slikcalc (1.0) was released. This release simplified some code, mainly the slikcalc.formatCurrency() method. There was also a bug where a calculator could be initialized more than once depending on timing that was fixed. As always, feel free to leave feedback on the library. Enjoy. Download Slikcalc 1.0

Also tagged | Leave a comment

Format Currency in Javascript (simplified)

While working on Slikcalc, I was trying to find the easiest way to format a number for currency. I had found some implementations that were pretty complex, using regex and absolute values, and thought there had to be a simpler way. This is what I came up with and so it works great in all the browsers I’ve tested (IE 6/7, Firefox 2 (windows & mac), Opera 9 (windows and mac).

function formatCurrency(num) {
  num = isNaN(num) || num === '' ? 0.00 : num;
  return parseFloat(num).toFixed(2);
}

Just thought I’d share for anyone working with something similar.

Also tagged | 32 Comments

Slikcalc – Easy Javascript Calculations

I’ve put together a small javascript library that greatly simplifies creating dynamic javascript calculators. It works great for just about anything, ranging from calculating columns of values, to a complex custom formula. You can even write your own calculators and plug them into the framework with little effort.

Slikcalc - Easy Javascript Calculations

Also tagged | 21 Comments

Page optimized by WP Minify WordPress Plugin