Pascal Peridont 18 vuotta sitten
vanhempi
commit
6d1e6ac837
1 muutettua tiedostoa jossa 10 lisäystä ja 0 poistoa
  1. 10 0
      std/mtwin/web/Request.hx

+ 10 - 0
std/mtwin/web/Request.hx

@@ -79,6 +79,16 @@ class Request {
 		return or;
 	}
 
+	public function getFloat( key : String, ?or : Float ) : Float {
+		if( params.exists(key) ){
+			var v = params.get(key);
+			if( v == "NULL" )
+				return null;
+			return Std.parseFloat(v);
+		}
+		return or;
+	}
+
 	public function getBool( key:String ) : Bool {
 		var val = params.get(key);
 		return (val != null) && (val == "1" || val == "true");