Skip to content

Commit

Permalink
Merge pull request #1 from kgediya/kgediya-patch-1
Browse files Browse the repository at this point in the history
Create ReactiveNumberToText.js
  • Loading branch information
kgediya authored Oct 25, 2020
2 parents a7ddb7e + 199723d commit e82cd72
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions ReactiveNumberToText.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//import statements
const Patches = require('Patches')
const Reactive = require('Reactive');

//Get Number Value
var score = Patches.outputs.getScalar('NumValue')
var str = ''

//Format String such as if less then 10, number will be in '01','02' etc format
str = score.ge(10).ifThenElse(score.toString(),Reactive.concat('0',score.toString()))

//Set variable output string value
Patches.inputs.setString('TextValue',str)

0 comments on commit e82cd72

Please sign in to comment.