excel_to_code 0.2.29 → 0.2.30

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fa747184660d6eb2e3a92bce25849e0683eff073
4
- data.tar.gz: a959fd27d7000dc9167a4e63972a544fef83e0a8
3
+ metadata.gz: efa73f5ef66a52e67a5026d4e791460a6b4a2544
4
+ data.tar.gz: add03f41738bc8df14386bfbb2cdadb25131a4ee
5
5
  SHA512:
6
- metadata.gz: 28b6848296a487e694634a2e208b7b96972d8b7efea4ca7d9eebd5d9c5bf5f667274638f367b757aae365acf32375beb45a2ab5502e900a3cc3ed5243e897732
7
- data.tar.gz: 600e18d8bdafd963d5dce0e626eb7821368855c69bb4df82acb06d618778c09b7283cef1e912c2d23cb9a575c3d65e531e6dec26bb0fd82ae5cb4f18b6e6e659
6
+ metadata.gz: dc43795e22c77771abf29b37a911149130c1686152c989cc9271ca06eb5b981aeeb709d4055f2160e98be0fd873f47964e7c90e8d0e9df723f48d9a1124429d1
7
+ data.tar.gz: bd26b2ab4e65db5fcbe19d57460be77bf23980a3410e45b84270bde1d0bf4e961218dfb44721afaa4f3c4e2799ef72f6bde1b3d6ba6818eb68fafd0a73ecdbfe
Binary file
@@ -2102,6 +2102,11 @@ static ExcelValue text(ExcelValue number_v, ExcelValue format_v) {
2102
2102
  sprintf(s, "%0.2f",number_v.number);
2103
2103
  free_later(s);
2104
2104
  result = new_excel_string(s);
2105
+ } else if(strcmp(format_v.string,"0.000") == 0) {
2106
+ s = malloc(100);
2107
+ sprintf(s, "%0.3f",number_v.number);
2108
+ free_later(s);
2109
+ result = new_excel_string(s);
2105
2110
  } else if(strcmp(format_v.string,"#,##") == 0) {
2106
2111
  s = malloc(100);
2107
2112
  setlocale(LC_ALL,"");
@@ -706,6 +706,7 @@ int test_functions() {
706
706
  assert(strcmp(text(new_excel_number(1.1518), ZERO).string, "1") == 0);
707
707
  assert(strcmp(text(new_excel_number(1.1518), new_excel_string("0.0")).string, "1.2") == 0);
708
708
  assert(strcmp(text(new_excel_number(1.1518), new_excel_string("0.00")).string, "1.15") == 0);
709
+ assert(strcmp(text(new_excel_number(1.1518), new_excel_string("0.000")).string, "1.152") == 0);
709
710
  assert(strcmp(text(new_excel_number(12.51), new_excel_string("0000")).string, "0013") == 0);
710
711
  assert(strcmp(text(new_excel_number(125101), new_excel_string("0000")).string, "125101") == 0);
711
712
  assert(strcmp(text(new_excel_number(123456789.123456), new_excel_string("#,##")).string, "123,456,789") == 0);
@@ -1,5 +1,5 @@
1
1
  class ExcelToCode
2
- def self.version() "0.2.29" end
2
+ def self.version() "0.2.30" end
3
3
  end
4
4
 
5
5
  require_relative 'commands'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: excel_to_code
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.29
4
+ version: 0.2.30
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thomas Counsell, Green on Black Ltd
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-07-02 00:00:00.000000000 Z
11
+ date: 2014-07-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubypeg