jscript Number constructor by locale - constructor

Does anybody know which symbol is used by jscript's Number constructor to separate decimal places? Is it always a dot or dependent on locale?
I´m trying to create a number as follows:
Number(2,11):
But the result is NaN
I would bet that the symbol is always a dot but I would like someone to confirm that. Is there a way to indicate which symbol should be used for decimal places?
Thank you.

It's always a dot, though there are a number of other legal syntaxes
http://www.ecma-international.org/ecma-262/5.1/#sec-9.3

Related

Scilab how to replace a comma with a dot in an matrix

May I ask for some advice, please?
I have for homework process data from file which has this structure:
"Time;Track;Force
s;mm;N
0,020;0,253;0,060
0,040;0,320;0,030
0,060;0,387;0,060
0,080;0,453;0,060
0,100;0,520;-0,000
0,120;0,587;0,030
0,140;0,654;0,030
0,160;0,721;-0,000
0,180;0,787;0,030
0,200;0,854;0,030
0,220;0,921;0,030
0,240;0,988;-0,000"
To load the data to matrix I use this command:
csvRead("Pene_1.txt",[';'],[],"string")
However my issue with this, is that the dates I would need in double because I will need to do some calculate with them, but in Europe a decimal point is used as the data separator instead of a decimal point. I would need to replace all of these decimal commas with decimal dots throughout the matrix. Please does anyone how to do it? Thanks you very much :)
by the way there I put whole file :)
http://leteckaposta.cz/859703762
Use csvRead("Pene_1.txt",';',',',"string") the third parameter ',' defines the decimal separator.

Strip decimals in SSRS expression without rounding

In my report I'm trying to remove the decimals without rounding. I'll be using this to set the minimum value in the vertical axis of the area chart.
So I tried =Format(98.56, "N0"), but this returns 99, which is incorrect. It should return 98.
I've been searching specifically for SSRS, but most of the results are for tsql.
My question: How can I remov decimals in SSRS without rounding?
Thanks
Try using "Floor". It effective rounds down to the nearest integer. You'll find this under the Math functions.
=Floor(Fields!Number.Value)
Note, there's also a Floor function in Transact-SQL that works the same way in case you need to do some of the processing in your SQL script.
Update based on request in comments
If you wanted to achieve the same result after the decimal point, all you need is a little algebra.
=Floor((Fields!Number.Value*10))/10
That should turn 99.46 into 99.4. Given that it shaves off the remainder, you could then tack on any additional zeroes you wanted.
I ended up converting to Int. The following expression in SSRS returns 98:
=Int(98.56)
I know the question is quite old, but as I ended up here having the same question I would like to share my answer:
While FLOOR and CEILING are fine if you take extra measures to handle numbers <0 or know they are always >=0, the easiest way to simply strip off the decimals is to use
=Fix(Fields!Number.Value)
FIX only returns the integer part of a number, without any rounding or transformation. For negative numbers Int rounds up.
Source: Examples for Fix, Floor and Ceiling
Source: Difference between Int and Fix

Flash remoting and floating point values

in xxxx.mxml (from flex) i have called the remote remote method (of java) the method return type is float
in the xxxx.mxml's remote objects result handler i need get the float values as Numeric.....or String..i tried with string...i did Alert.show to see the value some times i get exact value for eg, 0.5 is the value returning from java methid but here it will show 0.50000454...so on..how get the exact value?
It is because of the way floating point numbers are stored; basically they can't be stored precisely. A quick search in SO would reveal a lot of threads about this. Also read "What Every Computer Scientist Should Know About Floating-Point Arithmetic"
Thus the problem of getting the exact value boils down to what you define exact to be. Try rounding it to a given number of floating points at java end, convert the rounded number to a string (I'm not sure if this conversion would preserve the precision) and send that string.

ActionScript Parameter Filtering

I'm setting up a custom class that accepts some Number parameters, but i need to limit those parameters and would like to know the best way of doing so.
currently, i'm simply calling if statements, and throwing an error if the number is above or below what's accepted. for example, there is a parameter that accepts and angle, but only between 0 and 90. in the case i've typed it as a uint so now i only have to check to see if it's above 90. there's also a parameter Number typed parameter that only accepts values between the range of 0.0 and 1.0.
Is my method of using if statements and throwing erros the usual way of filtering parameters?
Yes. The only way to get around this is to use the type system, e.g. create an AcuteAngle class that can only contain a number between 0 and 90. However, for what you're doing, it's better to just have if statements.
Your only other option is to silently clip inputs to the desirable range (for example, angle = angle % 90;). The official AS libraries tend to use this approach more often than not, but they're not terribly consistent.

How to do number formatting to 1 decimal point in SSRS?

I have a SSRS report with full of number fields. I would like to have that to be displayed as in one decimal. i tried to use F1. it gives me only one decimal points in html rendering, but in excel exported version it shows 2 decimal points.
How can i have just one decimal point both ecxel and html rendering.
Please comment.
Thanks in advance
San
Use N1 as your Format Property setting. N denotes Numeric formatting, the 1 denotes the number of decimal places, so N2 would give you 102.02, for example. This should carry to excel as it is rendered in html.
Alternatively, you could use the format code #,##0.00, which will give you the thousands separator and two decimal places. '#' indicates optional characters, whilst '0' indicates mandatory characters (nulls will be replaced by '0.00').
in 2012 version: FormatNumber(Fields!col.Value,2)
Right click on the text box that contains the value you would like manipulate, select TEXT BOX PROPERTIES. Navigate to the Number tab, select Number and the # of Decimal places you want the box to allow for.