javascript math.round and math.floor work fine in IE and Opera but not Chrome, Safari or Firefox. Getting NaN
问题 Take a look at this fiddle: http://jsfiddle.net/gD3ax/1/ or here's the full markup <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Calculator</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <style type="text/css"> .header { font-size: 10pt; color: white; font-weight: 700; text-decoration: none; text-underline-style: none; text-line