Support Forum Softcomplex logo
About Us  | Services  | Download  | Order  | Support  | |
| Search | Today's Posts | Stats | Board Rules | Not logged in [ Login | Register ]
go to bottom
Last active: Never

Printable Version | Subscribe | Add to Favourites   Post new thread
Author: Subject: Conver paper weight from pounds (lbs) to gramms
tigra
Administrator

Posts: 2049
Registered: 6/17/2002
Location: US, CO
Member Is Offline
posted on 7/30/2009 at 05:22 PM Reply With Quote
Conver paper weight from pounds (lbs) to gramms


var a_baseFormats = {
'bond' : '17 x 22',
'bristol' : '22.5 x 28.5',
'card stock' : '20 x 26',
'cover' : '20 x 26',
'index' : '25.5 x 30.5',
'newsprint' : '24 x 36',
'tag' : '24 x 36',
'text' : '25 x 38',
'writing' : '25 x 38'
};

function f_getGramWeight (s_poundWeight) {
if (!s_poundWeight.match(/^(d+)(?:lb)?s+(.*)$/i)) return '?';
var n_weight = parseInt(RegExp.$1);
var s_baseFormat = RegExp.$2;
var s_baseSize = a_baseFormats[s_baseFormat.toLowerCase()];
if (!s_baseSize || !s_baseSize.match(/^([d.]+)s*xs*([d.]+)$/i)) return '?';
var n_width = parseFloat(RegExp.$1);
var n_height = parseFloat(RegExp.$2);
return Math.round((n_weight * 1406.5) / (n_width * n_height));
}

accepted values are in format like "80lb card stock"
View User's Profile View All Posts By User U2U Member
Post new thread

Related Links:

Go To Top


Powered by XMB 1.9.1 Nexus
Developed By Aventure Media & The XMB Group © 2002-2004