I am simply trying to access a `toWei` utils function on a front end website in JavaScript.

> 
> Since we removed our window.web3, MetaMask no longer automatically reloads the page on chain/network changes.
> 
> 
> (Source: <https://docs.metamask.io/guide/provider-migration.html#summary-of-breaking-changes>)
> 
> 
> 

So I am using `window.ethereum` which has been fine so far. But I can't find, even with considerable googling, a direct example of using `window.ethereum` to access a `.toWei(..)` function.

For example, I'd want something like:

```
var weiVal = window.ethereum.toWei(String(eth_float), 'ether');

```

But this particular function call doesn't exist. How can I do this?