This Question may not be related But am badly stuck in it and found no way except to ask question over here.
I've silverlight UserControl having a telerik textbox field that is RadMaskedNumericInput with #6 Mask value, means it could only have 6 digits. But when I examine my DataBase, some values of this field are like -2147483648.
I've tried to enter many values but unable to reproduce this scenario. I can only enter 6 digits from screen and I tried max 999999 but it remains the same.
Is there anyone having idea why its happening?? Any kind of help will be appreciated.
(Updated) I'm only getting textbox value, converting it to int and then insert it to Database through a Stored Procedure.
int value = (int)txtPrice.value;
I've tried to enter a negative value as well as trying to add letters but
due to mask, its not allowing me to add any value other than integers.
-2147483648 is int.MinValue.
It seems that the RadMaskedNumericInput field doesn't have a minimum value set or the default value isn't set.
You can set the minimum value using the MaskedInputExtensions.
For example,
<telerik:RadMaskedNumericInput Value="0" maskedInput:MaskedInputExtensions.Minimum="0" />
Related
I imagine this might be trivial but I don't know the correct terminology to search for a solution. What I need is when selecting an int value from a table column, it represents a number of possible Hex values which I would read using Hex Signed 2's complement. I am not sure what to store the Hex value as but it seems varbinary would be the likely option.
Table A holds the Enum's
EnumName nvarchar(10)
EnumValue varbinary(10)
Sample Values
(Val1,0x00000001),(Val2,0x00000002),(Val5,0x00000010)
It follows the patter 1,2,4,8 before moving on to the next place.
So as an example a value in Table b is -2147483648, using an online converter I can see the 2's complement is 80000000 so I can see in the enum list that it is the last value 0x80000000 (Value 28 in the table). However, some can have multiple values such as -2147090430 is 80060002 so this is the enums 0x00000002 (Value 2) and 0x80000000 (Value 28).
In SQL server there may be a way to do this but as I say, I don't know exactly what I am asking to search.
If anyone wants to correct my terminology I would be grateful.
So I'm trying to create a new variable column of ''first differences'' by subtracting values in the SAME column but have no clue how to do so on SPSS. For example, in this picture:
1st value - 0 = 0 (obviously). 2nd value - 1st value =..., 3rd value - 2nd value =..., 4th value - 3rd value =... and so on.
Also, if there is a negative number, does SPSS allow me to log it/regress it? Once I find the first difference, I'm going to LOG it & then regress it. For context, the reason I'm doing this is part of a bigger equation to find out how economic growth and a CHANGE in economic growth (hence the first difference and log) will affect the variable im studying.
Thanks.
To calculate differences between values in consecutive rows use this:
if $casenum>1 diffs = FinalConsumExp - lag(FinalConsumExp).
execute.
If you need help with additional problems please start a separate question for each problem.
HTH.
I know that similar questions have been asked again in the past, but I think my case is slightly different. I have a column which has Logarithmic values and I'm trying to invert them using the following formula:
SELECT POWER(10,CAST(9.695262723 AS NUMERIC(30,15)))
Let's say the value 9.695262723 is one of the values of that column.
When trying to run this query I get an Arithmetic overflow error for type int, value = 4957500001.400178.
On the other hand, the same query works fine for smaller values e.g. SELECT POWER(10,CAST(8.662644523 AS NUMERIC(30,15)))
How could I overcome that error and calculate the inverse values of the log10 entries I have? Just for information the greater value that exists in the table (in log10 scale) is 12.27256096.
The problem here is your first input parameter (10) which SQL server will, by default, treat as the datatype int.int has a maximum value of 2^31-1 (2,147,483,647), and the number 4,957,500,001 is far larger than this, so you need to use a bigint:
SELECT POWER(CONVERT(bigint,10),CONVERT(numeric(30,15),9.695262723));
Edit: If you need to retain the decimal places, then use a numeric with a large enough scale and precision, instead of bigint.
I have been working on ADempiere these past few days and I am confused about something.
I created a new column on my database table named Other_Number with the reference type Quantity. Max length is 20.
On my Java source, I used BigDecimal.
Now every time I try to input exactly 20 digits on the Other_Number field, the last 4 digits gets rounded. Say if I input 12345678901234567891. When I try to save it, it becomes 12345678901234567000.
Other than that. All the records that gets saved on the database (PSQL) gets appended with ".000000000000" (that's 12 zeros).
Now I need to do something so that when I input 20 digits, the last 4 digits don't get rounded.
Also I need to get rid of that ".000000000000"
Can you please tell me why this is happening?
ADempiere as a financials ERP software is crucial in how it deals with financial amounts. In the database the exact BigDecimal value has to maintain its data integrity. Precision and rounding has been done as perfect as possible in code. Been part of the established famous project Compiere ERP, where iDempiere and Openbravo are also forks from, such financial amount management is already well defined and solved.
Perhaps you need to set precision in its appropriate window http://wiki.idempiere.org/en/Currency_%28Window_ID-115%29
If it's not actually a number you want but rather some kind of reference field that contains only numeric digits, change the definition in the Application Dictionary to be:
Reference: String
Length: 20
Value Format: 00000000000000000000 (i.e. 20 Zeros!)
This will force the input be numeric only (i.e. alpha characters will be ignored!) and because it is a String there will be no rounding
Adempiere will support upto 14(+5) digits (trillions) amount/quantity of business (USD currency).
What currency you are using, is it possible to use this much amount/quantity in ERP system ?
If you want to change the logic, then you can change logic at the getNumberFormat method of DispalyType.java class.
What was the business scenario?
In Adempiere java code "setScale" Method is used to rounded the value
Example:
BigDecimal len= value
len= len.setScale(2,4);
setLength(len);
I am getting the following error in drupal while adding a content
PDOException: SQLSTATE[22003]: Numeric value out of range: 1264 Out of range
Amazingly this error happens on only 1 computer and all other computers are adding the content very fine. I defined the column with INT so there is no chance of mistake from database side. Kindly help me in this matter.
Regards.
This is because of range exceeding, in other words drupal is not just counting the digits, it is also calculating the digits that the must not exceed 99999999 in an integer datatype. Hope this helps.