{"action":"created","issue":{"url":"https://api.github.com/repos/ClosedXML/ClosedXML/issues/1078","repository_url":"https://api.github.com/repos/ClosedXML/ClosedXML","labels_url":"https://api.github.com/repos/ClosedXML/ClosedXML/issues/1078/labels{/name}","comments_url":"https://api.github.com/repos/ClosedXML/ClosedXML/issues/1078/comments","events_url":"https://api.github.com/repos/ClosedXML/ClosedXML/issues/1078/events","html_url":"https://github.com/ClosedXML/ClosedXML/issues/1078","id":383869086,"node_id":"MDU6SXNzdWUzODM4NjkwODY=","number":1078,"title":"Number Format doesn't work","user":{"login":"goskan93","id":39600021,"node_id":"MDQ6VXNlcjM5NjAwMDIx","avatar_url":"https://avatars1.githubusercontent.com/u/39600021?v=4","gravatar_id":"","url":"https://api.github.com/users/goskan93","html_url":"https://github.com/goskan93","followers_url":"https://api.github.com/users/goskan93/followers","following_url":"https://api.github.com/users/goskan93/following{/other_user}","gists_url":"https://api.github.com/users/goskan93/gists{/gist_id}","starred_url":"https://api.github.com/users/goskan93/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/goskan93/subscriptions","organizations_url":"https://api.github.com/users/goskan93/orgs","repos_url":"https://api.github.com/users/goskan93/repos","events_url":"https://api.github.com/users/goskan93/events{/privacy}","received_events_url":"https://api.github.com/users/goskan93/received_events","type":"User","site_admin":false},"labels":[{"id":698070643,"node_id":"MDU6TGFiZWw2OTgwNzA2NDM=","url":"https://api.github.com/repos/ClosedXML/ClosedXML/labels/RTFM","name":"RTFM","color":"e5d5b6","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-11-23T15:50:33Z","updated_at":"2018-11-28T12:29:38Z","closed_at":null,"author_association":"NONE","body":"I create a Table in Excel using Closed XML\r\n```\r\n            System.Data.DataTable table = AcompanhamentoDePropostaTable();\r\n            XLWorkbook wb = new XLWorkbook();\r\n            var ws = wb.Worksheets.Add(\"Acompanhamento - Cultura\");\r\n            ws.FirstCell().InsertTable(table, false);\r\n```\r\nProblem is that I have columns as string with values like $20000 or R$10000 (currency is changing) and I don't know how to set the currency type to these columns and not lose information about currency.\r\n\r\nMy code for now \r\n```\r\n            for(int j = 2; j<= lastrow; j++)\r\n            {\r\n                ws.Cell(j, 09).Style.NumberFormat.Format = ws.Cell(j, 9).Value.ToString() != \"\" ? ws.Cell(j, 9).Value.ToString().Contains(\"R$\") ? \"[$R$-pt-BR]#,##0.00\" : \"[$$-en-US]#,##0.00\" : \"\" ;\r\n            }\r\n```\r\nBut it does not change the format of values in my column.\r\nAny ideas how to do this? And maybe also there exist the way to not iterate row by row?\r\nThank You in advance.\r\n"},"comment":{"url":"https://api.github.com/repos/ClosedXML/ClosedXML/issues/comments/442430222","html_url":"https://github.com/ClosedXML/ClosedXML/issues/1078#issuecomment-442430222","issue_url":"https://api.github.com/repos/ClosedXML/ClosedXML/issues/1078","id":442430222,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0MjQzMDIyMg==","user":{"login":"vbjay","id":3629489,"node_id":"MDQ6VXNlcjM2Mjk0ODk=","avatar_url":"https://avatars3.githubusercontent.com/u/3629489?v=4","gravatar_id":"","url":"https://api.github.com/users/vbjay","html_url":"https://github.com/vbjay","followers_url":"https://api.github.com/users/vbjay/followers","following_url":"https://api.github.com/users/vbjay/following{/other_user}","gists_url":"https://api.github.com/users/vbjay/gists{/gist_id}","starred_url":"https://api.github.com/users/vbjay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vbjay/subscriptions","organizations_url":"https://api.github.com/users/vbjay/orgs","repos_url":"https://api.github.com/users/vbjay/repos","events_url":"https://api.github.com/users/vbjay/events{/privacy}","received_events_url":"https://api.github.com/users/vbjay/received_events","type":"User","site_admin":false},"created_at":"2018-11-28T12:29:38Z","updated_at":"2018-11-28T12:29:38Z","author_association":"CONTRIBUTOR","body":"You are making this too hard. You don't need to export the whole table. There is no need to have a column with curency info. \r\n\r\nUse linq to create an ienumerable based off the data table that only has the right values for the columns. Export them to the sheet. Then use linq against the table again and get formats from table indexed by row. Set correct formats of cells, they will still be in same order of the table. Loop and set format. "}}
{"actor":{"display_login":"vbjay"}}