Skip to content

Commit

Permalink
Umrechnung von Dezimal in Uhrzeit hinzugefügt
Browse files Browse the repository at this point in the history
  • Loading branch information
Zwixx committed Dec 6, 2023
1 parent b60d50d commit fa6e300
Showing 1 changed file with 25 additions and 2 deletions.
27 changes: 25 additions & 2 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,39 @@
<tr><td colspan="4" align="right">Summe:</td><td>{{ total }}</td></tr>
</tbody>
</table>
<table>
<caption>Industriestundenumrechnung</caption>
<thead>
<tr>
<th>Dezimal</th>
<th>Uhrzeit</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: center;"><InputNumber class="ZeitzeileEdit" v-model="decimal" :minFractionDigits="2" @input="updateValueDec($event.value)" /></td>
<td style="text-align: center;">{{ uhrzeit }}</td>
</tr>
</tbody>
</table>
</main>
</template>

<script lang="ts">
import { convertToTime } from './js/functions'
import { convertToTime } from './js/functions';
import InputNumber from 'primevue/inputnumber';
import Zeitzeile from './components/Zeitzeile.vue';
function sum(thys : any) {
let text = (thys.total1 + thys.total2 + thys.total3 + thys.total4 + thys.total5 + thys.total6 + thys.total7);
thys.total = text.toFixed(2) + " / " + convertToTime(text);
}
export default {
components: {
Zeitzeile
Zeitzeile,
InputNumber
},
data() {
return {
Expand All @@ -49,6 +67,8 @@ export default {
total6: 0,
total7: 0,
total: "",
decimal: 0,
uhrzeit: ""
};
},
methods: {
Expand Down Expand Up @@ -80,6 +100,9 @@ export default {
this.total7 = value;
sum(this);
},
updateValueDec(value : any) {
this.uhrzeit = convertToTime(value.toLocaleString('en-US', {minimumFractionDigits: 2}));
}
}
};
</script>
Expand Down

0 comments on commit fa6e300

Please sign in to comment.