Skip to content

Commit

Permalink
fix(demo): Update numeric formats
Browse files Browse the repository at this point in the history
  • Loading branch information
rene-leanix committed Dec 15, 2017
1 parent e8cb386 commit 8a7b278
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 20 deletions.
10 changes: 5 additions & 5 deletions demo/src/components/handsontable/advanced-demo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,17 @@ export class AdvancedDemoComponent {
this.colHeaders = ['Country', 'Level', 'Units', 'As Of', '1Y Chg', '5Y Ago', '10Y Ago', '25Y Ago'];
this.columns = [
{data: 0, type: 'text'},
{data: 1, type: 'numeric', format: '0,0.00[0000]'},
{data: 1, type: 'numeric', numericFormat: { pattern: '0,0.00[0000]' }},
{data: 2, type: 'text'},
{data: 3, type: 'numeric', format: '0'},
{data: 4, type: 'numeric', format: '0.00%', renderer:
{data: 3, type: 'numeric', numericFormat: { pattern: '0' }},
{data: 4, type: 'numeric', numericFormat: { pattern: '0.00%' }, renderer:
function percentRenderer(instance, td, row, col, prop, value, cellProperties) {
Handsontable.renderers.NumericRenderer.apply(this, arguments);
td.style.color = (value < 0) ? 'red' : 'green';
}
},
{data: 5, type: 'numeric', format: '0,0.00[0000]'},
{data: 6, type: 'numeric', format: '0,0.00[0000]'}
{data: 5, type: 'numeric', numericFormat: { pattern: '0,0.00[0000]' }},
{data: 6, type: 'numeric', numericFormat: { pattern: '0,0.00[0000]' }}
];
this.options = {
height: 396,
Expand Down
2 changes: 1 addition & 1 deletion demo/src/components/handsontable/basic-demo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export class BasicDemoComponent {
{
data: 'price',
type: 'numeric',
format: '$ 0,0.00'
numericFormat: { pattern: '$0,0.00', culture: 'en-US' }
},
{
data: 'isActive',
Expand Down
8 changes: 4 additions & 4 deletions demo/src/components/handsontable/finance-demo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ export class FinanceDemoComponent {
this.data = getFinanceData();
this.colHeaders = ['Price', 'Date', '1D Chg', 'YTD Chg', 'Vol BTC'];
this.columns = [
{type: 'numeric', format: '$0,0.00'},
{type: 'numeric', numericFormat: { pattern: '$0,0.00', culture: 'en-US' }},
{type: 'date', dateFormat: 'DD/MM/YYYY', correctFormat: true},
{type: 'numeric', format: '0.00%'},
{type: 'numeric', format: '0.00%'},
{type: 'numeric', format: '0.00'}
{type: 'numeric', numericFormat: { pattern: '0.00%' }},
{type: 'numeric', numericFormat: { pattern: '0.00%' }},
{type: 'numeric', numericFormat: { pattern: '0.00' }}
];
this.options = {
height: 396,
Expand Down
2 changes: 1 addition & 1 deletion demo/src/components/handsontable/personal-demo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export class PersonalDemoComponent {
const a42 = Array.apply(0, Array(42)).map((x, y) => y + 1);
if (a42.indexOf(row) !== -1 && col >= 1) {
cellProperties.type = 'numeric';
cellProperties.format = '$0,0.00';
cellProperties.numericFormat = { pattern: '$0,0.00', culture: 'en-US' };
}

return cellProperties;
Expand Down
8 changes: 4 additions & 4 deletions demo/src/components/handsontable/science-demo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@ export class ScienceDemoComponent {
columnSorting: true,
columns: [
{data: 0, renderer: 'html'},
{data: 1, type: 'numeric', format: '0[.]000000000000000'},
{data: 2, type: 'numeric', format: '0[.]000000000000000', renderer: heatmapRenderer},
{data: 3, type: 'numeric', format: '0[.]000000000000000'},
{data: 4, type: 'numeric', format: '0[.]000000000000000', renderer: heatmapRenderer}
{data: 1, type: 'numeric', numericFormat: { pattern: '0[.]000000000000000' }},
{data: 2, type: 'numeric', numericFormat: { pattern: '0[.]000000000000000' }, renderer: heatmapRenderer},
{data: 3, type: 'numeric', numericFormat: { pattern: '0[.]000000000000000' }},
{data: 4, type: 'numeric', numericFormat: { pattern: '0[.]000000000000000' }, renderer: heatmapRenderer}
],
afterLoadData: updateHeatmap,
beforeChangeRender: updateHeatmap,
Expand Down
10 changes: 5 additions & 5 deletions demo/src/components/handsontable/sport-demo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ export class SportDemoComponent {
{data: 0, type: 'numeric'},
{data: 1, type: 'text'},
{data: 2, renderer: 'html', width: 200},
{data: 3, type: 'numeric', format: '$0,0.00'},
{data: 4, type: 'numeric', format: '0.00%'},
{data: 5, type: 'numeric', format: '0.00%'},
{data: 6, type: 'numeric', format: '$0,0.00'},
{data: 7, type: 'numeric', format: '$0,0.00'}
{data: 3, type: 'numeric', numericFormat: { pattern: '$0,0.00', culture: 'en-US' }},
{data: 4, type: 'numeric', numericFormat: { pattern: '0.00%' }},
{data: 5, type: 'numeric', numericFormat: { pattern: '0.00%' }},
{data: 6, type: 'numeric', numericFormat: { pattern: '$0,0.00', culture: 'en-US' }},
{data: 7, type: 'numeric', numericFormat: { pattern: '$0,0.00', culture: 'en-US' }}
],
cells: (row, col, prop) => {
const cellProperties: any = {};
Expand Down

0 comments on commit 8a7b278

Please sign in to comment.