Percentages Inputted Into a Data Set

Hello,

I need a user form where a person can input a percentage then submit it to a data set. But it needs to be recognized as a percentage for future calculations to be done. Having the input and connected field set to text or number does not work.

Is this possible? Any help or suggestions will be greatly appreciated. Thank you!

Ben, it doesn´t work that way. A database is not a spreadsheet. Just do this:

  1. on the form, let user fill out a percentage (say: 35) and save that to a Number field in your dataset
    2)when you want to do your calculations, you write a small function like below to calculate the amount of discount from any starting amount. Example: you want to calculate 35% of 2000.

a)Inside your $w.onReady, put this:

 let baseAmount = 2000;
 let percentage= 35
 let amountDiscount = calcPercValue (baseAmount, percentage);
 let amountIncPercentage = baseAmount + amountDiscount;
 let amnountExPercentage = baseAmount - amountDiscount;
    console.log ("amountIncPercentage=" + amountIncPercentage);
    console.log ("amnountExPercentage=" + amnountExPercentage);

b)outside (=below) $w.onReady, put this:

function calcPercValue (incomingAmount, percentage) {
 let numAmountCalculated = incomingAmount * (percentage/100);
 return numAmountCalculated;
 
}

That´s it. Hope it´s clear.

Hello Giri,

I will give it a try! Thank you!