mirror of
https://github.com/nasa/openmct.git
synced 2024-12-19 05:07:52 +00:00
adds formatting for strings (#2792)
This commit is contained in:
parent
99a9f5b3ba
commit
eedc0f13bc
@ -81,6 +81,24 @@ define([
|
||||
return printj.sprintf(formatString, baseFormat.call(this, value));
|
||||
};
|
||||
}
|
||||
if (valueMetadata.format === 'string') {
|
||||
this.formatter.parse = function (value) {
|
||||
if (value === undefined) {
|
||||
return '';
|
||||
}
|
||||
if (typeof value === 'string') {
|
||||
return value;
|
||||
} else {
|
||||
return value.toString();
|
||||
}
|
||||
};
|
||||
this.formatter.format = function (value) {
|
||||
return value;
|
||||
};
|
||||
this.formatter.validate = function (value) {
|
||||
return typeof value === 'string';
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
TelemetryValueFormatter.prototype.parse = function (datum) {
|
||||
|
Loading…
Reference in New Issue
Block a user