> How to apply the formula? For example, folded and multiply by another number?
> And how to input to enter only numbers?
You can even specify the type="number" (htmlbook.ru/html/input/type)
but, not all browsers supported it seems.