Tags altered to allow string number values
This commit is contained in:
parent
ded9ac56aa
commit
a16262d43e
|
@ -58,7 +58,7 @@ namespace Mustache {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if ((condition is double || condition is int) && (targetValue is double || targetValue is int) ) {
|
if ((condition is double || condition is int) || (targetValue is double || targetValue is int) ) {
|
||||||
return Convert.ToDouble(condition) == Convert.ToDouble(targetValue);
|
return Convert.ToDouble(condition) == Convert.ToDouble(targetValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -55,12 +55,12 @@ namespace Mustache {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((condition is double || condition is int) && (targetValue is double || targetValue is int)) {
|
try {
|
||||||
return Convert.ToDouble(condition) > Convert.ToDouble(targetValue);
|
return Convert.ToDouble(condition) > Convert.ToDouble(targetValue);
|
||||||
|
} catch (Exception exception) {
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
@ -55,11 +55,14 @@ namespace Mustache {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((condition is double || condition is int) && (targetValue is double || targetValue is int)) {
|
try {
|
||||||
return Convert.ToDouble(condition) >= Convert.ToDouble(targetValue);
|
return Convert.ToDouble(condition) >= Convert.ToDouble(targetValue);
|
||||||
|
} catch (Exception exception) {
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using System.Linq.Expressions;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
|
||||||
namespace Mustache {
|
namespace Mustache {
|
||||||
|
@ -55,12 +56,14 @@ namespace Mustache {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((condition is double || condition is int) && (targetValue is double || targetValue is int)) {
|
try {
|
||||||
return Convert.ToDouble(condition) < Convert.ToDouble(targetValue);
|
return Convert.ToDouble(condition) < Convert.ToDouble(targetValue);
|
||||||
}
|
}
|
||||||
|
catch (Exception exception) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
@ -55,10 +55,12 @@ namespace Mustache {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((condition is double || condition is int) && (targetValue is double || targetValue is int)) {
|
try {
|
||||||
return Convert.ToDouble(condition) <= Convert.ToDouble(targetValue);
|
return Convert.ToDouble(condition) <= Convert.ToDouble(targetValue);
|
||||||
|
} catch (Exception exception) {
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue