how can I add kg or g in a field with numbers?
Under formats I can add several things, but not kg or g.
It is also in the front of the format, it should be in the back

Code: Select all
if (nuFormType() == 'edit' && !nuIsNewRecord()) {
nuCalculateForm(false);
}
function nuCalculated(t, v, fixed) {
// Replace you_calc_object_id with the object Id of "Gewicht nach Trocknung"
if (v.id = 'you_calc_object_id') t.value = v + ' kg';
}
Code: Select all
.input_with_appended_unit input {
padding-right: 22px;
text-align: right
}
.input_with_appended_unit span {
position: absolute;
font-family:"Helvetica Neue",Helvetica,Arial,sans-serif
}
Code: Select all
function nuAddUnitToInput(id, unit, top = 3, left = 8) {
let obj = $("#" + id);
obj.wrapAll('<div class="input_with_appended_unit"></div>');
let objUnitId = id + '_' + unit;
obj.after('<span id =' + objUnitId + '>' + unit + '</span>');
$('#' + objUnitId).css({
"top": obj.cssNumber("top") + top,
"left": obj.cssNumber("left") + obj.cssNumber("width") + left,
"font-size": obj.cssNumber("font-size")
});
}
Code: Select all
nuAddUnitToInput('Replace_with_your_Input_object_ID', 'kg')