• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

removing unwanted characters from supplied data

New Here ,
May 11, 2016 May 11, 2016

Copy link to clipboard

Copied

I have a calculation to perform with 2 pieces of client supplied data. Sometimes this data is provided as <0.1 rather than specifying 0.085 for instance.

I have tried using variable.replace(/>/g,"") to remove the '>' character to be able to use just 0.1 as the data for calculation, but to no avail.

Can someone help?

eg.

var custData1 = "<0.1";

var custData2 = "50";

var sData = custData1.replace(/>/g,"");

var cCalc = (sData/custData2)*100;

TOPICS
Acrobat SDK and JavaScript

Views

185

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 11, 2016 May 11, 2016

Copy link to clipboard

Copied

LATEST

Why are you removing ">" instead of "<"?

On Thu, May 12, 2016 at 12:01 AM, Chris72Caldwell <forums_noreply@adobe.com>

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines