@@ -611,14 +611,18 @@ class PredbatTableCard extends HTMLElement {
611611
612612 newRow . appendChild ( newColumn ) ;
613613
614- if ( column === "cost-column" )
614+ if ( column === "cost-column" ) {
615615 currentCost = parseFloat ( item [ column ] . value ) ;
616+ if ( isNaN ( currentCost ) ) currentCost = 0 ;
617+ }
616618
617619 if ( columnsWithTotals . includes ( column ) ) {
618620
619621 if ( column === "total-column" ) {
620622 if ( isMidnight ) {
621623 let currentTotal = parseFloat ( item [ column ] . value . replace ( / [ ^ 0 - 9 . \- ] / g, "" ) ) ;
624+ if ( isNaN ( currentTotal ) ) currentTotal = 0 ;
625+
622626 overallTotal [ column ] = ( overallTotal [ column ] || 0 ) + ( currentTotal * 100 ) ;
623627 dayTotal [ column ] = ( currentTotal * 100 ) + currentCost ;
624628 }
@@ -628,6 +632,7 @@ class PredbatTableCard extends HTMLElement {
628632
629633 overallTotal [ column ] = ( overallTotal [ column ] || 0 ) + val ;
630634 dayTotal [ column ] = ( dayTotal [ column ] || 0 ) + val ;
635+
631636 }
632637 }
633638
@@ -1327,6 +1332,7 @@ getTimeframeForOverride(timeString) {
13271332
13281333 if ( friendlyText . includes ( "ⅎ" ) ) {
13291334 friendlyText = friendlyText . replace ( 'Exp' , 'Export' ) ;
1335+ friendlyText = friendlyText . replace ( 'Chrg' , 'Charge' ) ;
13301336 friendlyText = "Manually Forced " + friendlyText ;
13311337 if ( ! friendlyText . includes ( "Charge" ) && ! friendlyText . includes ( "Discharge" ) && ! friendlyText . includes ( "Export" ) )
13321338 friendlyText = friendlyText + "Demand" ;
@@ -3738,7 +3744,6 @@ convertTimeStampToFriendly(timestamp){
37383744 if ( headerClassesArray [ headerIndex ] === "total-column" ) {
37393745
37403746 let totalCostString ;
3741- console . log ( totalCostCalculated , currentCost ) ;
37423747 // calculate new cost
37433748 if ( isCostReset )
37443749 totalCostString = "£" + ( ( totalCostCalculated - currentCost ) / 100 ) . toFixed ( 2 ) ;
0 commit comments