If i have a template (called **result**), a function (called **neww**), and a number (called **number** and randomly generated from 0-1), how would I create a boolean inside a helper that returned a true or false value based on if number was greater than 0.5 or not? I have:

Template.result.helpers({

‘neww’: function(){

return number > 0.5

}

});

But that always returns false.

Any answers would be appreciated, thanks.

In the code you have shown there is no visibility of where `number`

has come from. As shown it’s likely to be `undefined`

.

If all you want is to randomly generate a true/false and do not need to know the underlying value, you could use:

```
Template.result.helpers({
'neww': function(){
return Random.fraction() > 0.5; // or Math.random()
}
});
```

`Random.fraction()`

is available if you `meteor add random`

.

`Math.random()`

is always available, but is cryptographically weaker.