• home
  • blog
  • javascript
  • contact

Links

  • km0ti0n.blunted.co.uk

Recent Changes

  • /linux/setup/index
  • /linux/xen/xen-howto-ubunty-jaunty/index
  • /linux/xen/index
  • /linux/index
  • /cast/iron/guttering/cast-iron-guttering
  • /symantic-web/foaf
  • /css/opacity/index
  • /usenet/howto/index
  • /Goolge/IG/DomLookup/index
  • /pendrive/index
  • /linux/quickref/index
  • /home
  • /linux/sabayon/index
  • /win/server/MTU
  • /EventManagment/index
  • /win/win32_ssh_unix_utils
  • /linux/IEs4Linux
  • /css/CSS-Targeting-IE7
  • /pixel/index
  • /photography/index
  • /js/dragdrop/index
  • /js/Index
  • /js/mozXPath/index
  • /links/index
  • /css/rollovers
  • /linux/links
  • /about/index
  • /js/examples/Selects Value
  • /litestep/index
  • /sharpe/index
  • /js/examples/ComNum
  • /js/Printing/index
  • /Google/IG/Index
  • /links/Property
  • /OSX-Vmware/index
  • /EventFactoring/index
  • /js/ProperDOM/index
  • /js/examples/PropperDOM
  • /js/ajax/index
  • /Contact
  • /js/DefaultArgs/index
  • /js/examples/toCapatalize
  • /js/ObjFactory/Index
  • /js/examples/DynamicImage
  • /js/examples/Select's Value
  • /contact

ComNum

To com(m)afiy a number say from 1234567 to 1,234,567.

function test()
{
   n = "1234567";
   alert(n.replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g,"$1,"));
} 

Test the code

Credits to yossarian and h3h

Last Updated : 20/02/2006 @ 11:44

Valid XHTML 1.1

jsexamples

All trademarks and copyrights in this site are property of their respective owner.

Website design, graphics, textual content and code Copyright 2005 Andrew Scott. All rights reserved.