felixeu31
(Felixeu31)
September 11, 2017, 4:36pm
1
This issue is similar to one commented before. I’ve tryied to replace “,” for “.” Currenty working on angular 2
--------------------------------------------HTML-------------------------------------
<hotTable
[data]=“dataSource”
(after-change)=“afterChange($event)”
(after-on-cell-mouse-down)=“afterOnCellMouseDown($event)”
(beforePaste)=“beforePaste($event)”
[colHeaders]=“colHeaders”
[columns]=“columns”
[options]=“options”
[colWidths]=“colWidths”>
----------------------------------------------------------TS---------------------------------------
private beforePaste(e: any){
console.log(“beforePaste”)
var array = e[0];
for (var i = 0; i < e[0].length; i++) {
for (var j = 0; j < e[0][i].length; j++) {
e[0][i][j] = Number(e[0][i][j].replace(’,’, ‘.’))/100;
}
}
}
The replace method is apparently working properly, but it is it is pasting incorrect numbers
4,28 5,18 6,19
4,48 5,38 6,39
3,24 4,13 5,13
4,79 5,69 6,70
3,55 4,44 5,44
------------------->>
428 518 619
448 538 639
324 413 513
479 569 670
355 444 544
Hi @felixeu31
the dateFormat
should be passed via columns
settings.
felixeu31
(Felixeu31)
September 12, 2017, 9:41am
3
hi @aleksandra_budnik
Date formatting is relative to another issue i have. In this issue i am not able to copy properly from excel to handsontable.
I am trying to replace “,” for “.” but it is copying badly anyway.
Are you using the latest version of Handsontable? Could you share a demo that I can use to replicate the issue?
felixeu31
(Felixeu31)
September 17, 2017, 4:59pm
5
Hi, @aleksandra_budnik
I am currently tring to change the language but it seems like numbro is not working… When I try changing the language of a numeric column
{
data: 'parkings_AI',
type: 'numeric',
format: '0.0,00',
language: 'es-ES'
},
it trhows this error:
ERROR Error: Unknown culture : es-ES
at Function.webpackJsonp…/…/…/…/numbro/numbro.js.numbro.culture (numbro.js:827)
at numericRenderer (handsontable.js:21927)
at Object.cellRenderer (handsontable.js:22621)
at WalkontableTableRenderer.renderCells (handsontable.js:3956)
at WalkontableTableRenderer.renderRows (handsontable.js:3824)
at WalkontableTableRenderer.render (handsontable.js:3751)
at WalkontableTable._doDraw (handsontable.js:3458)
at WalkontableTable.draw (handsontable.js:3434)
at Walkontable.draw (handsontable.js:1182)
at TableView.render (handsontable.js:22900)
How I am supposed to change the language to a numeric column??
As you see I am tryng to set the format with a “,” for decimal delimitter
Big thanks
felixeu31
(Felixeu31)
September 17, 2017, 8:10pm
6
I already achieve it!!! I did it sth like this:
import * as numbro from ‘numbro’;
@Component ( {
selector: ‘mycomponent’,
templateUrl: ‘./mycomponent.html’
})
export class MyComponent {
constructor( ) {
numbro.loadCulturesInNode();
}
}
This way mi grid recognize “,” like decimal separator if needed, and I do not have any issue coppying numeric data into my table.
Hope it helps someone.
Great. So happy to hear that you’ve found a solution.
Thank you for sharing your investigation results.