on 10-21-2016 12:03 PM
Dear All,
Hope you are fine
I have a question about defining the number of decimals.
We have created a field in CustomerQuote.xbo with the type of: decimalValues.
I want to know is there any way that we can define the number of decimals for example to be always 2.
As I found it is not possible,
Does anyone have any idea?
Regards
Sin
Hi Sin,
You could use :
[Decimal (5,2)] element dAmt: DecimalValue;
where 5 is the number of digits allowed and 2 is the number of digits allowed after decimal place.
Thanks, Pradeep.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Pradeep,
Is there any builtin function or any sample code that can be used to calculate round up and round down of a decimal number.
For example: in 2 separate fields if a calculated value is 7.14 then this should be rounded off to 7 in one field and in other it should be rounded off to 8.
Do you have any idea how we can achieve this?
regards,
Rahul.
If you have already set the data type as Quantity, you cannot change it if you have deployed the solution to production.
You can use the combination of Numeric.RoundToString and Numeric.ParseFromString functions to round off the value stored in the extension field and convert it back to the type quantity during save.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Pradeep,
Thanks a lot for your response and sorry for my late answer,
Actually we have a custom field that is a type of "Quantity" and we want the decimal value to be shown max 2 number.
But when I add [Decimal (5,2)] to my element, the system gave me an error that
Parameter '[5,2]' of annotation Decimal is expected to be of type 'DecimalValue'.
But my DataType is Quantity, I can not change it,
Do you have any other suggetsion?
Regards
Sin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
101 | |
13 | |
13 | |
11 | |
11 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.