We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

CalcQuickBase - Getting Rid of Everything Except Numbers - use - Text Functions

Thread ID:

Created:

Updated:

Platform:

Replies:

143061 Mar 2,2019 06:25 PM UTC Mar 4,2019 12:18 PM UTC WinForms 1
loading
Tags: Calculate
Gregory Pe
Asked On March 2, 2019 06:25 PM UTC

Hi
Getting Rid of Everything Except Numbers


Linda has a column that contains alpha and numeric characters. She needs to retain the numeric characters and delete the alpha ones. For example, a cell may contain y,y.d?d10003pyu111 and she wants to end up with 10003111.

in excel is
=EXTRACTNUMBERS("yydd10003pyu111", TRUE)


is it possible to use - Text Functions
https://help.syncfusion.com/windowsforms/calculate/supported-formulas


CalcQuickBase cq


Regards,
Gregory



Arulraj A [Syncfusion]
Replied On March 4, 2019 12:18 PM UTC

Hi Gregory, 

Thanks for using Syncfusion product. 

To get the numeric value from the string, you could implement the custom function and include that function CalcEngine using AddFunction method. Please refer the following code example and the sample. 

C# 
private static CalcData calcData = new CalcData(); 
private static CalcEngine engine = new CalcEngine(calcData); 
engine.AddFunction("EXTRACTNUMBERS", new CalcEngine.LibraryFunction(ComputeEXTRACTNUMBERS)); 
 
var result = engine.ParseAndComputeFormula("EXTRACTNUMBERS(\"yydd10003pyu111\")"); 
Console.WriteLine("Result: " + result); 
 
public static string ComputeEXTRACTNUMBERS(String args) 
{ 
    string number = new String(args.Where(Char.IsDigit).ToArray()); 
    return number; 
} 
 
 

Please get back us if you need any further assistance on this. 

Arulraj A 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;