Alpha Release 0.3.0 - Runnercard generation #25

Merged
niggl merged 37 commits from dev into main 2021-02-12 17:03:29 +00:00
Showing only changes of commit d38923c4ad - Show all commits

View File

@ -56,11 +56,11 @@ function idToEan13(id): string {
while (id.length < 12) { id = '0' + id; }
let total = 0;
this.id.split('').forEach((letter, index) => {
id.split('').forEach((letter, index) => {
total += parseInt(letter, 10) * multiply[index % 2];
});
const checkSum = (Math.ceil(total / 10) * 10) - total;
return this.id + checkSum.toString();
return id + checkSum.toString();
}
async function postContracts(runners: Runner[]): Promise<Measurement> {