hi i need some help for converting the text become number types, i am using wix code to insert my user’s input field to my dataset by the code below, and i am confusing how to let the number type change to number cuz when i using my code let user input insert to dataset it automatically insert in text type but my dataset on that column is setting as number type so it can’t showing and ask me to convert to number type just then the item insert to dataset. So anyone can help me to solve this problem, thanks for helping.
i need the this to become number format
“referral” : $w ( ‘#affiliateId’ ). value ,
import wixUsers from 'wix-users';
import wixLocation from 'wix-location';
import wixData from 'wix-data';
let email = $w('#email').value;
let password = $w('#password').value;
let fullName = $w('#fullName').value;
let bank = $w('#bank').value;
let account = $w('#bankAccount').value;
let bankAccount = bank + " " + account;
let day = $w('#dobDay').value;
let month = $w('#dobMonth').value;
let year = $w('#dobYear').value;
let dob = day + " " + month + " " + year;
let toInsert = {
"email" : email ,
"password" : password ,
"fullName" : fullName ,
"contact" : $w('#contact').value ,
"referral" : $w('#affiliateId').value ,
"bank" : bank ,
"bankBranch" : "MALAYSIA LOCAL BANK" ,
"bankAccount" : account ,
"vip" :"wix:image://v1/06458d_73166763d2f44d3c8c98446edd957061~mv2.png/_.png#originWidth=343&originHeight=437" ,
"vipLevel" : "I - STUBBORN BRONZE" ,
"vipTarget" : "5,000" ,
"currentVipProgress" : "0.00" ,
"walletBalance" : "0.00" ,
"dobDay" : day ,
"dobMonth" : month ,
"dobYear" : year ,
"dateOfBirth" : dob ,
"country" : $w('#country').value ,
"language" : $w('#language').value ,
"creditRatingPoints" : "100" ,
"creditRatingLevel" : "LEVEL 1" ,
"userAccount" : bankAccount
};
export function register_click(event) {
$w("#errorMessage").collapse();
$w("#wait").expand();
wixUsers.register(email,password)
.then(()=>{
wixData.insert("MemberAccount", toInsert)
.then( (results) => {
let item = results;
wixLocation.to('/account/myaccount');
})
.catch( (err) => {
console.log(err);
$w("#errorMessage").expand();
$w("#wait").collapse();
})
})
.catch( (err) => {
console.log(err);
$w("#errorMessage").expand();
$w("#wait").collapse();
})
}
thanks