Vorbly <Code>
CODING MADE EASY WITH VORBLY
WIX CODE CONVERT DECIMALS TO INTEGER
Need to convert decimal numbers to integers? This tutorial will show you how to convert decimal numbers to integers (round down) using Wix Code. You will be able to round-down decimal numbers to integers for calculations on your website. We will provide you with the webpage elements and sample codes required to implement this feature.
THE DEMO
THE ELEMENTS
The Page
User Input: #amount
Text Element: #Number
THE CODE
Page Code
$w.onReady(function () {
$w('#Number').text = Math.floor($w('#amount').value).toString();
});
COMMENTS
I'm a paragraph. Click here to add your own text and edit me. It's easy.