Quantcast
Channel: SCN : All Content - All Communities
Viewing all articles
Browse latest Browse all 8338

Design Studio SDK: Math Util Component

$
0
0

Let's bring a bit of mathematics into the Application development with Design Studio!

 

If you ever wanted to...

  • round, sum, calculate average, median,
  • use some other math functions

 

then this component is for you ;-)

 

Background

This component is as short response to the question from mohd fahad inMath.round() in Design Studio 1.4?

 

Technical Background

It simply delegats the functions in ZTL to Math library, for some is uses custom calculations (sum, average, percentage, median).

 

What's next?

is there something missing for you in this library? just comment and we can extend it.

 

Examples

 

     Median...

COLLECTION_1.removeAllItems();

 

COLLECTION_1.addItem("", "", 23.0);

COLLECTION_1.addItem("", "", 45.0);

COLLECTION_1.addItem("", "", 84.0);

COLLECTION_1.addItem("", "", 11.0);

 

var a = MATH_1.medianV(COLLECTION_1.getAsKeyLabelValueArray());

 

INPUTFIELD_3.setValue(""+a);

 

     Average...

var a = MATH_1.average(["4.7", "5.2", "7"]);

 

 

 

INPUTFIELD_3.setValue(""+a);

 

     Round...

var a = INPUTFIELD_1.getValue();

var aF = Convert.stringToFloat(a);

 

INPUTFIELD_3.setValue(""+MATH_1.round(aF));

 

Help / API Specification

Go directly to the help site and find the component: http://org-scn-design-studio-community.github.io/sdkinstall/web/components/index.html

 

Download & Use

This component is available on the community package, as in SCN Design Studio SDK Development Community

 

Example as ZIP:

Release Client Information & Flow Layouter · org-scn-design-studio-community/applications · GitHub

 

Any thoughts?

feel free to add as usual...


Viewing all articles
Browse latest Browse all 8338

Trending Articles