mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-06-05 04:12:15 +02:00
15 lines
521 B
JavaScript
15 lines
521 B
JavaScript
.pragma library
|
|
|
|
|
|
function intToString(v) {
|
|
// use EN locale to get comma separated thousands
|
|
// + remove automatically added trailing decimals
|
|
// (this 'toLocaleString' does not take any option)
|
|
return v.toLocaleString(Qt.locale('en-US')).split('.')[0]
|
|
}
|
|
|
|
// Convert a plain text to an html escaped string.
|
|
function plainToHtml(t) {
|
|
var escaped = t.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>'); // escape text
|
|
return escaped.replace(/\n/g, '<br>'); // replace line breaks
|
|
}
|