This is an automated email from the ASF dual-hosted git repository.
harbs pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git
The following commit(s) were added to refs/heads/develop by this push:
new 313f81e Added getPercent
313f81e is described below
commit 313f81e39c609f7207a6c2bcd08ce4ba53bf7aa3
Author: Harbs <[email protected]>
AuthorDate: Tue Jan 5 12:41:21 2021 +0200
Added getPercent
---
.../org/apache/royale/utils/number/getPercent.as | 24 ++++++++++++++++++++++
.../org/apache/royale/utils/number/pinValue.as | 18 ++++++++++++++++
2 files changed, 42 insertions(+)
diff --git
a/frameworks/projects/Core/src/main/royale/org/apache/royale/utils/number/getPercent.as
b/frameworks/projects/Core/src/main/royale/org/apache/royale/utils/number/getPercent.as
new file mode 100644
index 0000000..80cb81b
--- /dev/null
+++
b/frameworks/projects/Core/src/main/royale/org/apache/royale/utils/number/getPercent.as
@@ -0,0 +1,24 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package org.apache.royale.utils.number
+{
+ public function getPercent(numerator:Number,denominator:Number):Number{
+ return pinValue((numerator / denominator) * 100,0,100);
+ }
+}
\ No newline at end of file
diff --git
a/frameworks/projects/Core/src/main/royale/org/apache/royale/utils/number/pinValue.as
b/frameworks/projects/Core/src/main/royale/org/apache/royale/utils/number/pinValue.as
index 61c9e83..327938f 100644
---
a/frameworks/projects/Core/src/main/royale/org/apache/royale/utils/number/pinValue.as
+++
b/frameworks/projects/Core/src/main/royale/org/apache/royale/utils/number/pinValue.as
@@ -1,3 +1,21 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
package org.apache.royale.utils.number
{
/**