Skip to content

Commit

Permalink
pass 1082
Browse files Browse the repository at this point in the history
  • Loading branch information
tychy committed Sep 12, 2024
1 parent 01e5c75 commit 09c27b3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
7 changes: 6 additions & 1 deletion toukibo/stock_converter.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
package toukibo

import "strings"
import (
"strings"
)

func StockToNumber(stock string) int {
// 発行済株式の総数5万株 → 50000
stock = strings.Replace(stock, "発行済株式の総数", "", -1)
if strings.HasPrefix(stock, "普通株式") { // sample1082用のハック
stock = strings.Replace(stock, "普通株式", "", -1)
}
stock = ZenkakuToHankaku(stock)

sums := 0
Expand Down
5 changes: 5 additions & 0 deletions toukibo/stock_converter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ func TestStockToNumber(t *testing.T) {
input: "発行済株式の総数5万株",
expected: 50000,
},
{
// sample1082
input: "発行済株式の総数普通株式     5138株A種優先株式   1250株B種優先株式   3250株",
expected: 5138,
},
}

for _, tc := range testCases {
Expand Down

0 comments on commit 09c27b3

Please sign in to comment.