Created
February 25, 2018 09:40
-
-
Save AhsanAyaz/d2c2f2951d406261d41f833ace9c3ce3 to your computer and use it in GitHub Desktop.
Watch Service used with the Stop Watch Box Component I built using Stencil
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export class WatchService { | |
/** | |
* @author Ahsan Ayaz | |
* @desc Calculates the units and sets in string format. | |
* @param unit value of the unit in numbers | |
* @return {string} the string representation of the unit's value with at least 2 digits | |
*/ | |
getTimeString(unit: number): string { | |
return (unit ? (unit > 9 ? unit : "0" + unit) : "00").toString(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment