Skip to main content
Participating Frequently
April 27, 2019
Answered

Please help to convert this excel formula in java script if(text32>601,text32*1,text32*text10) Thanks in Anticipation

  • April 27, 2019
  • 1 reply
  • 1230 views

if(text32>601,text32*1,text32*text10)

Please help to convert above mentioned formula in java script

Thanks in anticipation

This topic has been closed for replies.
Correct answer Bernd Alheit

Why does you multiply with 10?

1 reply

BarlaeDC
Community Expert
Community Expert
April 27, 2019

Hi,

Assuming the fieldNames are text32 and text10

then the if would be

var text32Value =  this.getField("text32").value;

if ( text32Value <= 601) {

     var result = text32Value * 10;

} else {

     var result = text32Value;

}

As to what you want to do with result, you would need to explain more about your form? This would probably be best placed on the Validate of text32, as then it is only run if text32 changes.

Regards

Malcolm

Bernd Alheit
Community Expert
Bernd AlheitCommunity ExpertCorrect answer
Community Expert
April 27, 2019

Why does you multiply with 10?

Participating Frequently
April 27, 2019

Text10 is the qty and Text 32 is value the logic is if text32 value goes beyond 602 $ it will remain 602 in the total result.

if Text32 is lower then 602 $ it will multiply with qty and give the result as given in image.

Kindly help to provide the script

Thanks in advance.