Telephone mask (number format) with variable lenght [closed] - google-sheets

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
I was looking for the best solution to mask cells with telephone numbers like the example:
(+55 11) 99999-9999
Normally I'd use (+## ##) #####-#### as a custom number format. The problem is that the length of the number may vary. Nine numbers for cellphones and eight for home numbers. So, with a mask like that, an eight number phone would be formated like (+5 51) 19999-9999

Well, while posting this question I found the solution I wanted using Custom Number Format with conditions based on the number value.
[<=999999999999](+00 00) 0000-0000; [>999999999999](+00 00) 00000-0000;

Related

How to access MACD value and signal (both 2 data) in mql4 [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
I am trying to create a robot in mql4 for forex trading.So i need to access both MACD value and MACD signal value.But it looks like only providing MACD value without MACD signal value.Please help me to access those values.
enter image description here
It provides u with both value pls look to my code
double macdBaseIndicatorLine = iMACD(NULL,0,12,26,9,PRICE_CLOSE,MODE_MAIN,0);
double macdSignalIndicatorLine =iMACD(NULL,0,12,26,9,PRICE_CLOSE,MODE_SIGNAL,0);
thats how you get the values, pls give me a like if it helps u thx

Why is everything a tuple in swift? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 years ago.
Improve this question
So I found out that any variable or constant in swift is a tuple. For example, variable x below is a tuple
var x = 15
and following statement is valid and evaluates to value of x as the first element of tuple
x.0.0.0.0.0.0.0.0.0.0.0 // outputs 15
I'm wondering why the language has been built to accommodate this. Any known (or outworldly) use case?
I don't know can it be the right answer, but it gives some information and shows that it's a known thing. Look this 2 sections:
Special: The 1-Tuple
Bonus Track: Tuples All the Way Down

NSDecimalNumber to double. What is the correct way to do this in Swift [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I've been searching for a clean and correct way to convert an NSDecimalNumber retrieved from CoreData to a Double.
I'm looking for a recommendation on how to do this. I need to take 2 decimal numbers from my CoreData and calculate a percentage to use in a progress bar etc.
NSDecimalNumber has a property var doubleValue: Double { get }. So you can say num.doubleValue.
For division of two NSDecimalNumbers you should use num1.dividing(by: num2).
Keep in mind that in Swift you can also use Decimal which supports +, *, /, etc.

Limit a NSMutablestring's length [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
I am working on a calculator App.
The NSMutablestring is used for calculation E.g "5-3*8-(-1)/77".
But the label can't display endless an NSMutablestring, so is there have any way to limit NSMutablestring's length?
(not too long, I want the NSMutablestring's length to be less than 100).
You can get the first 100 characters of a string as follows:
NSString *first100chars = [myString substringToIndex:100];
However, it sounds like you need to prevent the user from actually entering a string this long, which is a different problem. The comments to your question give examples of other people asking similar questions (e.g. Set the maximum character length of a UITextField), I suggest you check those.
This is a job for an NSFormatter subclass. That's exactly what it's for.

Google Docs: Extract numbers from cell, then sum them and display in another cell [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
How can I write a formula for column B that will find numbers in A, then sum and display them in B?
Here's the example:
A B
Milan 2I + Marko 3I 5 what happened: 2+3=5, display 5
Nevena 6I + Umic 4I 10 what happened: 6+4=10, display 10
Things I've tried:
left, right, mid - can't work because names are random;
some formulas which only give me the first number, without the second;
writing a UDF in C but failed to convert it to javascript code;
tried converting letters into 0s, then summing all the numbers in
that one cell.
Things I've thought of but don't know how to pull off:
writing a formula that finds numbers that are followed by "I".
Note: The only constant thing in the cells is the fact that each number is followed by "I"
This should work for finding the two numerical values, however it is a bit convoluted and I'm sure it can be abstracted to a few cells to make it easier and more efficient. Assume A1 is the cell of your string.
=SUM(VALUE(MID(A1,FIND(REGEXEXTRACT(A1,"[0-9]I"),A1),LEN(REGEXEXTRACT(A1,"[0-9]I"))-1)),VALUE(MID(A1,FIND(REGEXEXTRACT(REGEXREPLACE(A1,CONCATENATE("^.{",FIND(REGEXEXTRACT(A1,"[0-9]I"),A1)-1,"}[0-9]I",""),""),"[0-9]I"),A1),LEN(REGEXEXTRACT(REGEXREPLACE(A1,CONCATENATE("^.{",FIND(REGEXEXTRACT(A1,"[0-9]I"),A1)-1,"}[0-9]I"),""),"[0-9]I"))-1)))

Resources