Merge pull request #52 from ThaumRystra/user-story-127
Added 'if' function for math.js to use whenever eval-ing input, closes #32
This commit is contained in:
@@ -1,3 +1,12 @@
|
||||
// if we want to add more functions, consider pulling out into its own file
|
||||
(function() {
|
||||
math.import({
|
||||
"if": function(pred, a, b) {
|
||||
return (!!(pred)) ? a : b;
|
||||
}
|
||||
});
|
||||
})();
|
||||
|
||||
//evaluates a calculation string
|
||||
evaluate = function(charId, string){
|
||||
if (!string) return string;
|
||||
|
||||
Reference in New Issue
Block a user