I'm trying to show a currency dynamicly, that works totally fine!
But I'd like to change the pattern from "SFr. 150'000.00" to "150'000.00 SFr." (and still keep it dynamicly!)
Any suggestions how I could do that?
Here is the code:
<fmt:setLocale value="${pageContext.request.locale}" scope="session" />
<fmt:formatNumber type="currency" value="${investVolume}" />
Thanks in advance!
<fmt:formatNumber type="currency" value="${investVolume}" pattern="###,###.## ¤"/>
The pattern attribute follows DecimalFormat rules.
The ¤ in the pattern represents the currency symbol.
Although I'm not sure if that ' would show in an upper or lower position this should be the way to go.
Related
ERROR: .ArgumentException: The value representation '3/7/2021' does not match the mask.
I am using the MaskedTextBox (from xceed wpftoolkit). I would like the user to input and see a clean date as "__/__/____" in typical US fashion as MM/dd/yyyy.
The following works correctly for "3/7/2021",
<xceed:MaskedTextBox Width="240" FontSize="28" IncludeLiteralsInValue="True" Value="{Binding EffectiveDateFrom, UpdateSourceTrigger=LostFocus}" ValueDataType="{x:Type s:DateTime}" Mask="0/0/0000" />
but fails when the mask is changed to
Mask="00/00/0000"
So how is a mask written that will allow for both dates as "12/30/1999" or "3/7/2021" ?
Thank you for any help on this. (Note: I am not opposed to any solution: I have seen some suggestions to use the DatePicker instead. Any thoughts?)
TIA
According to their documentation what you want is: 90/90/0000
If you use #0/#0/0000 you would have to type the leading spaces!
HTH
I want to use the "data-error-message" to display custom text for a filed if its not filled. Alternatively I want to show custom text "data-type-number-message" if the field does not contain a number.
They do not seem to work together? My code below...
<input name="port" type="text" id="port" size="25" data-required="true" data-error-message="Port is required." data-type="number" data-type-number-message="Numbers Only"/>
Thoughts?
You should be using data-required-message instead of data-error-message for the "Port is required" message.
Also, you may want digits instead of number if this is for a port-number field.
You can use "data-error-message" or "data-parsley-error-message", depending on your install, for a generalized error response.
I want to assign some value with included smarty value to another, like this:
{assign var="one" value="hello world {$two}"}
but error is happened. Please help how resolve it.
you should not use limiters in limiters i guess.
{assign var="one" value="hello world $two"}
worked for me.
Resolved
{assign var="one" value="hello world $two"}
The simplest solution to this particular case is to use the |cat modifier, since modifiers can be used wherever you would normally have a string or variable.
{assign var=one value="hello "|cat:$two}
I am trying to make a regex check for my time input text and also I am trying to mask the input. I don't know if both can be done at the same time with this code:
<p:inputMask mask="99:99" size="5" maxlength="5" required="true" requiredMessage="#{account_req_txt}" value="#{user.accountNo}">
<f:validateRegex pattern="[01]?[0-9]|2[0-3]):[0-5][0-9]"/>
<p:ajax event="blur" update="sysMsg" />
</p:inputMask>
I am getting "must be a number consisting of one or more digits." error. What is wrong with above code?
How exactly is the "account number" as represented by #{user.accountNo} a time? That part is confusing. In any way, the error suggests that the accountNo is actually a Number like Integer, Long, etc, not a String.
Perhaps you meant to bind it to #{user.time} or something else. At least, the value must be bound to a String, otherwise you need to create a Converter to convert between a String in 99:99 representation to a number type in 9999 representation.
I am looking to find all attributes of an element that match a certain pattern.
So for an element
<element s2="1" name="aaaa" id="1" />
<element s3="1" name="aaaa" id="2" />
I would like to be able to find all attributes that start with 's' (returning the value of s1 for the first element and s3 for the value of the second element).
If this is outside of xpath's ability please let me know.
Use:
element/#*[starts-with(name(), 's')]
This XPath expression selects all atribute nodes whose name starts with the string 's' and that are attributes of elements named element that are children of the current node.
starts-with() is a standard function in XPath 1.0
element/#*[substring(name(), 1,1) = "s"]
will match any attribute that starts with 's'.
The function starts-with() might look better than using substring()
I've tested the given answers from both #Dimitre-Novatchev and #Ledhund, using lxml.html module in Python.
Both element/#*[starts-with(name(), 's')] and element/#*[substring(name(), 1,1) = "s"] return only the values of s2 and s3. You won't be able to know which value belong to which attribute.
I think in practice I would be more interested in finding the elements themselves that contain the attributes of names starting with specific characters rather than just their values.
To achieve that is very simple, just add /.. at the end,
element/#*[starts-with(name(), "s")]/..
or
element/#*[starts-with(name(), "s")]/parent::*
or
element/#*[starts-with(name(), "s")]/parent::node()
None from above worked for me.
So I did not some changes and it worked for me. :)
/*:UserCustomField[starts-with(#name, 'purchaseDate')]