• 224 Vote(s) - 2.75 Average
• 1
• 2
• 3
• 4
• 5

10-30-2013, 03:39 PM,
 umemura Moderator Reputation: 9 Posts: 445 Joined: Jul 2011

グリッドの中で、整数と小数の両方を表示する場合に、

10-30-2013, 03:56 PM,
 umemura Moderator Reputation: 9 Posts: 445 Joined: Jul 2011
RE: 円貨と外貨の桁を合わせたい
エクセルだと、小数点以下を0で埋めるか、整数の場合にも小数点が表示される方法しかなかったのですが、
http://www.relief.jp/itnote/archives/000418.php

Curl であれば、下記のような方法で実現できそうですね。
パディングの処理は、ゼロ埋めなどにも使えそうです。

フォントが等幅フォントである必要がありますが。

Code:
```||空白をパディングする {define-proc public {padding str:String, length:int, padding-char:char = ' '}:String     let ret:String = str     def padding-amount = length - ret.size     {if padding-amount > 0 then         set ret = ret & {String.repeat-char padding-char, padding-amount}     }     {return ret} } ||少数桁位置を合わせる {define-proc public {alignment str:String, digit-size:int}:String     let ret-val:String = ""     def str-ary:StringArray = {str.split split-chars = '.'}     {switch str-ary.size     case 1 do         set ret-val = str & {padding "", digit-size + 1}     case 2 do         set ret-val = str-ary[0] & "." & {padding str-ary[1], digit-size}     else         {return str}     }     {return ret-val} } {let people:RecordSet =     {RecordSet         {RecordFields             {RecordField "amount", domain = String}         },         {RecordData amount = "12345.6789"},         {RecordData amount = "123"},         {RecordData amount = "1.0000"},         {RecordData amount = "1.00"},         {RecordData amount = "1.20"},         {RecordData amount = "1.2"}     } } {value     {RecordGrid         font-family = "ＭＳ ゴシック",         font-size = 10pt,         record-source = people,         {RecordGridColumn             halign = "right",             "amount"         },         {RecordGridColumn             "amount",             halign = "right",             format-spec =                 {proc {data:any, record:Record}:String                     {return {alignment data asa String,  4}}                 }         }     } }```
11-19-2013, 07:08 PM,
 shahid11 Junior Member Reputation: 0 Posts: 1 Joined: Nov 2013
RE: 円貨と外貨の桁を合わせたい

 « Next Oldest | Next Newest »

Forum Jump:

Users browsing this thread:
1 Guest(s)

## MyBB SQL Error

MyBB has experienced an internal SQL error and cannot continue.

SQL Error:
1017 - Can't find file: 'mybb_threadviews' (errno: 2)
Query:
INSERT INTO mybb_threadviews (tid) VALUES('998')