Index: config.json
===================================================================
--- config.json	(revision 77)
+++ config.json	(revision 79)
@@ -45,6 +45,5 @@
       "copy-files" :
       {
-        "files" : ["index.html", "pf.html", "sprintf.js", "wz_jsgraphics.js",
-                   "entities.js"],
+        "files" : ["index.html", "pf.html", "wz_jsgraphics.js", "entities.js"],
         "target" : "${BUILD_PATH}"
       }
Index: source/class/pf/Application.js
===================================================================
--- source/class/pf/Application.js	(revision 78)
+++ source/class/pf/Application.js	(revision 79)
@@ -1,9 +1,9 @@
 /* ************************************************************************
 
-   Copyright:
-
-   License:
-
-   Authors:
+   Copyright: Weizmann Institute of Science
+
+   License: GPL
+
+   Authors: Evgeny Stambulchik
 
 ************************************************************************ */
@@ -16,27 +16,4 @@
 ************************************************************************ */
 
-
-function NumPrint(v, prec)
-{
-    var s;
-    
-    if (prec == null) {
-        prec = 3;
-    }
-    
-    if (v == 0.0) {
-        s = "0";
-    } else
-    if (!isFinite(v)) {
-        s = v;
-    } else
-    if (Math.abs(v) < 1.e6 && Math.abs(v) >= 0.1) {
-        s = sprintf("%." + prec.toString() + "f", v);
-    } else {
-        s = sprintf("%." + prec.toString() + "e", v);
-    }
-    
-    return s;
-}
 
 function changeN_e(ev)
@@ -909,10 +886,10 @@
                 var value = scale*this.evaluateEntityValue(entity, species);
 
-                rowData.push({ s_icon   : {icon       : icon,
-                                           iconWidth  : 16, 
-                                           iconHeight : 16             },
-                               name     : {text       : name           },
-                               section  : {text       : entity.section },
-                               value    : {text       : NumPrint(value)}
+                rowData.push({ s_icon  : {icon       : icon,
+                                          iconWidth  : 16, 
+                                          iconHeight : 16             },
+                               name    : {text       : name           },
+                               section : {text       : entity.section },
+                               value   : {text       : pf.util.Format.numPrint(value)}
                              });
             }
Index: source/class/pf/ui/TextField.js
===================================================================
--- source/class/pf/ui/TextField.js	(revision 72)
+++ source/class/pf/ui/TextField.js	(revision 79)
@@ -5,5 +5,5 @@
     
     construct: function(v) {
-        this.base(arguments, NumPrint(v));
+        this.base(arguments, pf.util.Format.numPrint(v));
     },
     
@@ -12,5 +12,5 @@
         setNumValue: function(v)
         {
-            this.setValue(NumPrint(v));
+            this.setValue(pf.util.Format.numPrint(v));
         },
 
Index: source/class/pf/ui/canvas/Plotter.js
===================================================================
--- source/class/pf/ui/canvas/Plotter.js	(revision 72)
+++ source/class/pf/ui/canvas/Plotter.js	(revision 79)
@@ -83,6 +83,6 @@
                 this.dPoint2vPoint(tracker.dp, tracker.vp);
                 this.vPoint2wPoint(tracker.vp, tracker.wp);
-                tracker.setLabel("X: " + NumPrint(tracker.wp.x) +
-                    "<br>Y: " + NumPrint(tracker.wp.y));
+                tracker.setLabel("X: " + pf.util.Format.numPrint(tracker.wp.x) +
+                    "<br>Y: " + pf.util.Format.numPrint(tracker.wp.y));
                 tracker.setLeft(tracker.dp.x + 12);
                 tracker.setTop(tracker.dp.y - 12);
@@ -361,5 +361,6 @@
                 
                 if (major_tick) {
-                    this.drawStringV(vp1, NumPrint(wval, prec), halign, valign);
+                    this.drawStringV(vp1,
+                        pf.util.Format.numPrint(wval, prec), halign, valign);
                 }
             }
Index: source/class/pf/util/Format.js
===================================================================
--- source/class/pf/util/Format.js	(revision 79)
+++ source/class/pf/util/Format.js	(revision 79)
@@ -0,0 +1,99 @@
+/*
+ * Based on sprintf() for JS v.0.1 by Alexandru Marasteanu
+ * <http://alexei.417.ro/>
+ */
+
+
+qx.Class.define("pf.util.Format",
+{
+    statics :
+    {
+        _strRepeat : function(i, m)
+        {
+            for (var o = []; m > 0; o[--m] = i);
+            return(o.join(''));
+        },
+        
+        sprintf : function()
+        {
+	    var i = 0, f = arguments[i++], o = [], m, a, p;
+	    while (f) {
+		if (m = /^[^\x25]+/.exec(f)) {
+                    o.push(m[0]);
+                } else
+                if (m = /^\x25{2}/.exec(f)) {
+                    o.push('%');
+                } else
+                if (m = /^\x25(\+)?(0|'[^$])?(-)?(\d+)?(\.\d+)?([b-fosuxX])/.exec(f)) {
+		    if (!(a = arguments[i++])) {
+                        throw("Too few arguments.");
+                    }
+		    if (/[^s]/.test(m[6]) && (typeof(a) != 'number')) {
+	                throw("Expecting number but found " + typeof(a));
+		    }
+                    switch (m[6]) {
+		    case 'b':
+                        a = a.toString(2);
+                        break;
+		    case 'c':
+                        a = String.fromCharCode(a);
+                        break;
+		    case 'd':
+                        a = parseInt(a);
+                        break;
+		    case 'e':
+                        a = m[5] ? a.toExponential(m[5].charAt(1)) : a.toExponential();
+                        break;
+		    case 'f':
+                        a = m[5] ? parseFloat(a).toFixed(m[5].charAt(1)) : parseFloat(a);
+                        break;
+		    case 'o':
+                        a = a.toString(8); break;
+		    case 's':
+                        a = ((a = String(a)) && m[5] ? a.substring(0, m[5].charAt(1)) : a);
+                        break;
+		    case 'u':
+                        a = Math.abs(a);
+                        break;
+		    case 'x':
+                        a = a.toString(16);
+                        break;
+		    case 'X':
+                        a = a.toString(16).toUpperCase();
+                        break;
+		    }
+		    a = (/[def]/.test(m[6]) && m[1] && a > 0 ? '+' + a : a);
+		    p = m[4] ? this._strRepeat(m[2] ? m[2] == '0' ? '0' : m[2].charAt(1) : ' ', m[5] ? m[4] - String(a).length : m[4]) : '';
+		    o.push(m[3] ? a + p : p + a);
+		} else {
+                    throw("Huh ?");
+                }
+		f = f.substring(m[0].length);
+	    }
+	    return(o.join(''));
+        },
+        
+        numPrint : function(v, prec)
+        {
+            var s;
+
+            if (prec == null) {
+                prec = 3;
+            }
+
+            if (v == 0.0) {
+                s = "0";
+            } else
+            if (!isFinite(v)) {
+                s = v;
+            } else
+            if (Math.abs(v) < 1.e6 && Math.abs(v) >= 0.1) {
+                s = this.sprintf("%." + prec.toString() + "f", v);
+            } else {
+                s = this.sprintf("%." + prec.toString() + "e", v);
+            }
+
+            return s;
+        }
+    }
+});
Index: source/pf.html
===================================================================
--- source/pf.html	(revision 72)
+++ source/pf.html	(revision 79)
@@ -4,5 +4,4 @@
     <title>Plasma Formulary Interactive</title>
     <script type="text/javascript" src="script/pf.js"></script>
-    <script type="text/javascript" src="sprintf.js"></script>
     <script type="text/javascript" src="wz_jsgraphics.js"></script>
     <script type="text/javascript" src="entities.js"></script>
Index: urce/sprintf.js
===================================================================
--- source/sprintf.js	(revision 1)
+++ 	(revision )
@@ -1,51 +1,0 @@
-/**
- * sprintf() for JavaScript v.0.1
- *
- * Copyright (c) 2007 Alexandru Marasteanu <http://alexei.417.ro/>
- *
- * This program is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License as published by the Free Software
- * Foundation; either version 2 of the License, or (at your option) any later
- * version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
- * details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-function str_repeat(i, m) { for (var o = []; m > 0; o[--m] = i); return(o.join('')); }
-
-function sprintf() {
-	var i = 0, f = arguments[i++], o = [], m, a, p;
-	while (f) {
-		if (m = /^[^\x25]+/.exec(f)) o.push(m[0]);
-		else if (m = /^\x25{2}/.exec(f)) o.push('%');
-		else if (m = /^\x25(\+)?(0|'[^$])?(-)?(\d+)?(\.\d+)?([b-fosuxX])/.exec(f)) {
-			if (!(a = arguments[i++])) throw("Too few arguments.");
-			if (/[^s]/.test(m[6]) && (typeof(a) != 'number'))
-				throw("Expecting number but found " + typeof(a));
-			switch (m[6]) {
-				case 'b': a = a.toString(2); break;
-				case 'c': a = String.fromCharCode(a); break;
-				case 'd': a = parseInt(a); break;
-				case 'e': a = m[5] ? a.toExponential(m[5].charAt(1)) : a.toExponential(); break;
-				case 'f': a = m[5] ? parseFloat(a).toFixed(m[5].charAt(1)) : parseFloat(a); break;
-				case 'o': a = a.toString(8); break;
-				case 's': a = ((a = String(a)) && m[5] ? a.substring(0, m[5].charAt(1)) : a); break;
-				case 'u': a = Math.abs(a); break;
-				case 'x': a = a.toString(16); break;
-				case 'X': a = a.toString(16).toUpperCase(); break;
-			}
-			a = (/[def]/.test(m[6]) && m[1] && a > 0 ? '+' + a : a);
-			p = m[4] ? str_repeat(m[2] ? m[2] == '0' ? '0' : m[2].charAt(1) : ' ', m[5] ? m[4] - String(a).length : m[4]) : '';
-			o.push(m[3] ? a + p : p + a);
-		} else throw("Huh ?");
-		f = f.substring(m[0].length);
-	}
-	return(o.join(''));
-}
