パッケージ: | Global |
定義ファイル: | Ext-more.js |
クラス: | Number |
継承元: | Object |
メソッド | 定義クラス | |
---|---|---|
constrain(
Number min, Number max
)
:
Number変数内の数値を抑制します。max値とmin値で指定した範囲内の場合は、変数内の数値をそのまま返却します... Checks whether or not the current number is within a desired range. If the number is already with... 変数内の数値を抑制します。max値とmin値で指定した範囲内の場合は、変数内の数値をそのまま返却します。 もし、範囲外の場合は、変数内の数値がはみ出した方の値が返されます。上限(max値)を超えた場合は、max値が 下限(min値)を超えた場合はmin値が返されます。 Checks whether or not the current number is within a desired range. If the number is already within the range it is returned, otherwise the min or max value is returned depending on which side of the range is exceeded. Note that this method returns the constrained value but does not change the current number. パラメータ:
| Number |