DecimalSeparator in PrimeNG Spinner does not work - primeng

When I set decimal separator to anything (eg comma), it reverts back to period on blur. Even clicking increment and decrement, it does not use comma but period.
Moreover, if I am using decimalSeparator and step properties together, in which format should I set the step?
Here's what my html looks like...
<p-spinner [(ngModel)]='selected' [decimalSeparator]="','" [step]="'0,1'"></p-spinner>
I have tried the values without quote & variable as well but no luck.
Thanks in advance.

PrimeNG 7 doesn't support decimalSeparator and thousandSeparator. You can make an upgrade to PrimeNG 8.0.2, then you can use the parameters and formatInput too.

Related

angular way to use number with comma and dot to calculate another value

I am using angularJS and Angular Material Design.
For one of the amount field i have input box as below which displays calculated field.
Whenever the value is stored it is stored as comma separated i.e. 19,999.9984 which is not a problem for me.
But whenever i use this value for another calculation, i get NaN.
$scope.txn.toUnits = $scope.txn.toAmount / $scope.txn.toPrice
Above expression end up with NaN since there is a comma in toAmount value 19,999.9984
Is there any angular way to resolve this ?
You could use the parseFloat function
This is a best solution to do this if it interests you :
http://numeraljs.com/

How to avoid leading whitespace being trimmed off of directive string bindings?

I'm creating a custom directive that I want to use to display the value of a field and an optional suffix (expected for units and such). Note that my example is shortened to stay concise.
My template looks something like
<div class="my-value">{{boundValue}}{{boundSuffix}}</div>
For the value, I'm using a two-way binding (=) and for the suffix, I'm using a string binding (&).
It worked great when I bound &deg into the suffix to display a temperature, but when I tried to bind in meters (note, there's a leading space - I don't want it pushed up against the number) the leading space seems to get trimmed and my result ends up looking like 123meters.
Using the chrome developer tools, I added a link function and inspected the directive's scope. By the time it reaches the link function, boundSuffix has already been trimmed. It seems like Angular is pulling some shenanigans on my behind the hood. Is there any way for me to avoid this trimming?
It's better to use angular filters to solve your problem. Filters allow to format your output as currency or as UPPERCASE (for example). Try to look here for more info. And here is working example

Programmatically Position Image on RDLC using Database Values

I have an image that I'd like to programmatically position on an RDLC based on the X and Y values from the database. I originally thought I could just apply an expression to the Left and Top properties of the Location property, however it doesn't seem like there's an option to do that.
Is there anything I can do?
EDIT:
Fortunately the padding property allows expressions, however it seems I have another issue on my hands.
Here's my code for the "Left" property within the "Padding" property group.
=((Sum(Fields!intDessinX.Value, "dsRapport_uspReportCommandeInhumation") * 2.54) / 96) & "cm"
Essentially I'm converting the intDessinX value from the database from pixel to cm using the formula "cm = (pixel * 2.54) / 96" and finally appending "cm" to the end of the expression.
This does not work. I've done some research and can't seem to find how to take the value from a dataset and translate it into a measurement.
Does anyone know how to do this?
Thanks,
Mikael
Solved!! Since we're developing the website in French we had previously set the culture to "fr-CA" and this causes the decimal character to be replaced by a comma character.
As such, when it came time for the reporting engine to evaluate the value (with the comma), it wasn't positioning my image as it simply didn't understand that the value was in fact numeric.

How can I change tag separator in drupal 7?

I want to change tag separator in a Term reference field of my content type (using Autocomplete term widget (tagging)) from "," to "+" or maybe something else (in Drupal 7) because this field needs to be filled with multi lingual (persian and english) words and the "," is "،" in persian so I want a character which is same in both of these languages to prevent user changing their keyboard input.
What shoud I do now?
thanks.
You may take a look at Active Tags module.
Ideal answer of my question according to this issue is :
in drupal/include/common.inc file, change line
$regexp = '%(?:^|,\ *)("(?>[^"]*)(?>""[^"]* )*"|(?: [^",]*))%x'; to
$regexp = '%(?:^|,|،|\ *)("(?>[^"]*)(?>""[^"]* )*"|(?: [^",|،|]*))%xu';
Now both English and Persian comma is available for separator so I will not worry about change keyboard language or not!

Custom Format String that doesn't show trailing "." when the number is whole

We're currently using a custom format string: "#,###.##"
In our DevExpress control in the following way:
"Settings:TextEditSettings MaskType="Numeric" DisplayFormat="#,###.00;;#" Mask="#,###.##"/"
Imagine the input to this is the double "20.000".
We'd like this to be "20.00" in display mode, and "20" in edit mode (i.e. what the Mask is trying to specify). We find that this almost works, but there we get "20." in edit mode. Can anyone advise on a format string that does not have the trailing "." when the number is whole?
Thanks.
For display mode use "0#.0#" and in Edit mode use "0#"
[Edit]: Since your showing commas for display, use "0#,###.0#"

Resources