File tree Expand file tree Collapse file tree 1 file changed +14
-8
lines changed
Resources/scripts/commands Expand file tree Collapse file tree 1 file changed +14
-8
lines changed Original file line number Diff line number Diff line change @@ -1202,14 +1202,20 @@ Utils.addFormatedText = function (json) {
12021202 }
12031203
12041204 // apply default date formatting
1205- if ( _noFormatInfo ( )
1206- && ( ( typeof ( cell . value ) === 'string' )
1207- && ( cell . value . startsWith ( "/OADate(" ) )
1208- && ( cell . value . endsWith ( ")/" ) ) ) ) {
1209- if ( cell . value . indexOf ( "." ) > - 1 ) {
1210- _createFormatInfo ( longDatePattern ) ;
1211- } else {
1212- _createFormatInfo ( shortDatePattern ) ;
1205+ if ( _noFormatInfo ( ) ) {
1206+ if ( ( typeof ( cell . value ) === 'string' ) ) {
1207+ if ( ( cell . value . startsWith ( "/OADate(" ) ) && ( cell . value . endsWith ( ")/" ) ) ) {
1208+ _createFormatInfo ( ( cell . value . indexOf ( "." ) > - 1 ) ? longDatePattern : shortDatePattern ) ;
1209+ }
1210+ }
1211+ else if ( ( ( typeof ( cell . value ) === 'number' ) ) ) {
1212+ let fixed = Number ( cell . value . toFixed ( 13 ) ) . toString ( ) ;
1213+ if ( fixed != cell . value . toString ( ) ) {
1214+ if ( ! ( 'style' in cell ) ) {
1215+ cell . style = { } ;
1216+ }
1217+ cell . style . formatInfo = { text : Number ( cell . value . toFixed ( 13 ) ) . toString ( ) } ;
1218+ }
12131219 }
12141220 }
12151221
You can’t perform that action at this time.
0 commit comments