MCPcopy Create free account
hub / github.com/microsoft/SandDance / negateNum

Function negateNum

docs/app/js/sanddance-app.js:22304–22309  ·  view source on GitHub ↗

* Given a string value in a space delimited format (e.g. "1 2 3 4"), negates a particular value.

(value, partIndex)

Source from the content-addressed store, hash-verified

22302/**
22303 * Given a string value in a space delimited format (e.g. "1 2 3 4"), negates a particular value.
22304 */ function negateNum(value, partIndex) {
22305 var parts = value.split(" ");
22306 var numberVal = parseInt(parts[partIndex], 10);
22307 parts[0] = parts[0].replace(String(numberVal), String(numberVal * -1));
22308 return parts.join(" ");
22309}
22310/**
22311 * Given a string quad, flips the left and right values.
22312 */ function flipQuad(value) {

Callers 1

rtlifyRulesFunction · 0.85

Calls 1

replaceMethod · 0.80

Tested by

no test coverage detected