Skip to content

Instantly share code, notes, and snippets.

@scott-kloud
Created October 10, 2016 12:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save scott-kloud/82b31d83fc83ac8f751626ee3ec020f1 to your computer and use it in GitHub Desktop.
Save scott-kloud/82b31d83fc83ac8f751626ee3ec020f1 to your computer and use it in GitHub Desktop.
<configuration doc:name="dataWeaveFunctions">
<expression-language>
<global-functions>
def convertToTime(duration) {
hours = Math.abs(duration / 60);
mins = Math.abs(duration % 60);
return String.format("%2d:%02d", hours, mins);
}
</global-functions>
</expression-language>
</configuration>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment