format ‘12345′ to ‘12,345′
javascript:
string.replace(/(\d)(?=(\d\d\d)+(?!\d))/g, function(s){return s+","})
ruby:
string.gsub(/(\d)(?=(\d\d\d)+(?!\d))/) { |match| match + ',' }
DecimalFormat class also can be used.
format ‘12345′ to ‘12,345′
javascript:
string.replace(/(\d)(?=(\d\d\d)+(?!\d))/g, function(s){return s+","})
ruby:
string.gsub(/(\d)(?=(\d\d\d)+(?!\d))/) { |match| match + ',' }
DecimalFormat class also can be used.
a popual ruby on rails, part1 and part2. there is other tutorial based on rails 2.1. basicly, grammer has some changes between 2.0, 2.1 and 2.2.
work on the ruby on vista.
firstly, install ruby
next, install rails, by command “gem install rails”
then, create a new web app by rails by “rails project”.
if “project” has been create, it can be runned by command “ruby script/server webrick”.
lastly, open address “http://localhost:3000″ web browser.
I have install follow service on my vps hosting:
samba – file and print server
lighttpd – a fast webserver
python – script language
ruby – script programming language