Orbeon Concatenate Number and % symbol - xpath

Following is the requirement, Input box should
1. Accept only Numbers
2. Once User enters Number it should concatenate '%' in same control

I fixed this like this
Took normal Input
Replaced %
Checked whether its number
It works fine for me.
Here is the complete code
matches(replace($ControlName,'%',''), '^[0-9_]+$')
Don't forget put his code under validation.

Related

TI-BASIC (TI-82) making output position dependent on number of digits of a variable

So I made a point system for a game on the TI-82. The points are stored as the variable P. I first tried using the Disp command to display the variable and text at the right place, but that didn't work with mixed text and variables. So instead I switched to using the output command, but that always puts the variable and text at a fixed position, which means that as the variable gets more digits, the space between the variable and text shrinks. I tried using the log of the variable for the position, but that didn't work because most of the time it returned decimals. Here is my current code for displaying the points:
Output(2,1,P
Output(2,3,"POINTS
Does anyone know how to increase the spacing between the variable and the text depending on how many digits the variable has?
Log works if you round it down and add 1.
int(log(P)) + 1
will give you the number of digits. Why not just round up instead? Because log(10) = 1 but 10 is 2 digits.
This is pretty simple, just put the variable after the points, so instead of doing:
Output(2,1,P
Output(2,3,"POINTS
Do instead:
Output(2,1,"POINTS
Output(2,8,P

Only allow whole numbers but display with '.' on the thousand for easy read

I want to apply data validation to my column so as to only accept whole numbers.
However I want these to be displayed with a dot so as to make it easier to read later on.
e.g. input = 14354 which is valid and then displayed 14.354
the data validation regular expression I am ussing is:
=regexmatch(to_text(A2);"^\d+\.*\d+$")
and the custom formatting is:
#,##
for most this working fine, large numbers are displayed with the '.' and things it shouldnt accept it is rejecting.
However, in the case of numbers which are entered with a decimal point as these are hidden, it is accepting it as valid.
It is also changing the format to auto atic and reading as date such entries like: 15.4
I should point out that I am using sheets in spanish and therefore the , is the marker for decimal places.
What am i missing here??
Select the cell range then go to Data > Data validation...
Add a custom formula rule:
=mod(A1;1)=0
Try this one:
=and(regexmatch(to_text(A2);"^\d+(\.\d{3})*$");mod(A2;1)=0)
Improved your formula to only accept a dot when it is followed by 3 numbers (this way, we invalidate the date e.g A2)
Combining the improved formula of yours and Aresvik's modulo answer, we need to check if the value does not have decimal. (this way, we invalidate the decimal e.g A6)
When both returns true, this shall confirm that the number inputted is a whole number with no decimal and not a date.
Output:
Invalid inputted values:
A2 - 15.4
A6 - 16412,212

Custom Data Validation with possible Number or Word

Ok so here is what I have so far. The following works properly preventing non numbers and more than 2 occurrences of each number.
=AND(ISNUMBER(K2),COUNTIF(K$2:K$20,K2)<3)
Next I need to add in the option for the field to be 'BYE'.
So each of the cells can contain a number that cannot occur more than twice or it can contain 'BYE'
Anyone have any advice on how to achieve this? Is there a way to say it can be like this or like that?
You could use OR.
=OR(K2="BYE",AND(ISNUMBER(K2),COUNTIF(K$2:K$20,K2)<3))

c++11 Using regex for input validation

I have been looking forever how I can use Regex to validate input for c++ 11. What I basically would like is a piece of code that validates a number input within a specific range (for this example lets say 0-9). It should only allow numbers that I want the user to enter within the range. How can I do this?

Dreamweaver SPRY Custom Validation Format

I want a textfield to validated using dreamweaver spry option. I need the input to be in the below mentioned format
05632-25252525
The first (05632) part should contain minimum 3 no's, maximum upto 6.
The second (05632) part should contain minimum 7 no's, maximum upto 10.
how can i write a regular expression or a pattern in Spry. pls suggest
Spry can't handle that as all one text field.
However, if you make it two textfields, then it's simplicity...just set the first one to have min 3 character, max 6 only allow numbers. Set the second to be min7 max10 all numbers and then just combine them after the form is posted.

Resources