Skip to main content
Inspiring
October 10, 2024
Answered

Formatting number

  • October 10, 2024
  • 1 reply
  • 565 views

Hello 

Appreciate help if there are any script to remove any numbers after (.) And symbol (.) Also

For example

If I write feild like that

 it will be shown at another field like that

 name of  first field : text 1

    name of second field: text 2

This topic has been closed for replies.
Correct answer try67

As the custom Calculation script of the second field you can use something like this:

event.value = this.getField("text 1").valueAsString.match(/^\d*/)[0];

 

Edit: small mistake in the code fixed

1 reply

try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
October 10, 2024

As the custom Calculation script of the second field you can use something like this:

event.value = this.getField("text 1").valueAsString.match(/^\d*/)[0];

 

Edit: small mistake in the code fixed

ali_3480Author
Inspiring
October 10, 2024

Awesome 

It is Working 

Many thanks dear for your support