![]() |
IT Team - Processed HTML
General Utilities |
![]() |
These dynamic modules provide some general use utilities. For each module the HTML code to use is followed by a description of what the module does and some examples. The names of the modules are Case Sensitive. Be sure to use the right capitalization.
Each page that uses these modules must start with this include statement as
one of the first lines of the HTML page.
<!-- #include virtual = "/include/gen_utils.inc" -->
These are variables set to use as regular expressions in string matches or
replacements.
/* Regular Expressions */
var Browsers = /Mozilla\/[234]/;
var Browser_IE = /MSIE/;
var DateDash = /\d\d?-\d\d?-\d\d\d?\d?/;
var DateSlash = /\d\d?\/\d\d?\/\d\d\d?\d?/;
var Digits = /[\d\.]+/;
var EndSpaces = / +$/;
var FindColon = /:/g;
var FindPlus = /\+/g;
var FindSlash = /\//g;
var FindSpace = / /g;
var FindTic = /'/g;
var FindQuote = /"/g;
var FindQuoteholder = /:':/g;
var ItemNumber = /[0-9]{4}/;
var Letters = /[A-Za-z]/;
var NonUserChars = /[^A-Za-z0-9\.-]/;
var NonTextChars = /[^\w \.-]/;
var NonEmailChars = /[^\w\.@-]/;
var TitleChars = /[^ \w\$\?\.\(\)%&-;:'",/]/;
var debug = 0;
function FormatNumber(value, style, places, round_off, commas) {
| value - | real, the number to be evaluated. default - 0 |
| style - | integer, predefined styles.
default - 0
1 - price $ xx,xxx.xx 2 - percent x.xx % |
| places - | integer, the number of decimal places in the returned number. default - 2 |
| round_off - | boolean, should the number be rounded at the least significant digit? Must be a value that will evaluate T/F. default - 0 (false - no - truncate number) |
| commas - | boolean, should the number be broken with commas at the orders of 10? Must be a value that will evaluate T/F. default - 0 (false - no) |
| width - | width of table in percent. default - none |
| spacing - | spacing between cells. default - 3 |
| padding - | padding between cell contents and cell walls. default - 5 |
| border - | width of table border in pixels. default - 0 |
| prompt - | title for field (left column). default - |
| value - | information to display (right column). default - |
| col1_width - | size of left hand column in pixels or percent. default - none |
| left_align - | align value for lefthand column. default - left |
| right_align - | align value for righthand column. default - left |
| when - | the date to be displayed. default - now |
| month_style - | m - date as mm/dd/yyyy default M - date as Month dd, yyyy |
| year_style - | y - year as two digit number (lowercase) Y - year as four digit number (uppercase) default |
| disp_day - | if true then also display day of week at beginning. Should be a value that will evaluate T/F. only valid with month_style = M. default - false |
| disp_time - | if true then also display hh:mm. Should be a value that will evaluate T/F. default - false |
URL: http://
www3.extension.umn.edu/units/cets/it/processed/gen_utils.html This page was updated Jan. 9, 2001
.
Online Privacy Statement. Contact Information.
University of Minnesota Extension is an equal opportunity
educator and employer.
Copyright © Regents of the University of
Minnesota. All rights reserved.