国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 開發 > 綜合 > 正文

一個有用的東西:如何將數字轉換為大寫英文金額

2024-07-21 02:35:59
字體:
來源:轉載
供稿:網友

  create or replace function tcos_spell_number( p_number in number )
  return varchar2
  -- CopyRight Toshiba Shenzhen Han Fangquan 2002.04.10
  as
  type myArray is table of varchar2(255);
  l_str myArray := myArray( '',
  ' Thousand ', ' Million ',
  ' Billion ', ' Trillion ',
  ' Quadrillion ', ' Quintillion ',
  ' Sextillion ', ' Septillion ',
  ' Octillion ', ' Nonillion ',
  ' Decillion ', ' Undecillion ',
  ' Duodecillion ' );
  l_num varchar2(50) default trunc( p_number );
  h_number number;
  l_return varchar2(4000);
  begin
  h_number := round(p_number*100)/100;
  for i in 1 .. l_str.count
  loop
  exit when l_num is null;
  
  if ( substr(l_num, length(l_num)-2, 3) <> 0 )
  then
  l_return := to_char(
  to_date(
  substr(l_num, length(l_num)-2, 3),
  'J' ),
  'jsp' ) l_str(i) l_return;
  end if;
  l_num := substr( l_num, 1, length(l_num)-3 );
  end loop;
  -- add Dollars string. Han Fangquan
  -- Han Fangquan modified begin
  if l_return is null then l_return := 'Zero' ;
  end if;
  -- p_number >1 then add Dollars else Add Dollar.
  if trunc( h_number )>1
  then
  l_return := l_return ' Dollars ';
  else
  l_return := l_return ' Dollar ';
  end if;
  
  if to_char( h_number ) like '%.%'
  then
  l_num := substr(h_number,instr(h_number,'.')+1);
  if length(l_num)=1
  then
  l_num := l_num '0';
  end if;
  if l_num > 0
  then
  if l_num > 1
  then
  l_return := l_return 'And 'l_num' Cents ';
  else l_return := l_return 'And 'l_num' Cent ';
  end if;
  end if;
  end if;
  -- end (Han Fangquan modified )
  /*
  -- beginning of section added to include decimal places:
  if to_char( h_number ) like '%.%'
  then
  l_num := substr( h_number, instr( h_number, '.' )+1 );
  if l_num > 0
  then
  l_return := l_return ' point';
  for i in 1 .. length (l_num)
  loop
  exit when l_num is null;
  if substr( l_num, 1, 1 ) = '0'
  then
  l_return := l_return ' zero';
  else
  l_return := l_return
   ' '
   to_char(
  to_date(
  substr( l_num, 1, 1),
  'j' ),
  'jsp' );
  end if;
  l_num := substr( l_num, 2 );
  end loop;
  end if;
  end if;
  */
  
  -- end of section added to include decimal places
  -- Han if the length fo l_trun less than 100 ,i will add **
  -- if length(l_return) < 100
  -- then
  -- l_return := l_return
  -- substr('****************************************************************************************************',
  -- length(l_return)-1) ;

  -- end if;
  l_return := l_return'*************';
  return l_return;
  end tcos_spell_number;

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 辉南县| 漠河县| 江西省| 荣昌县| 公安县| 江口县| 营口市| 孝感市| 台前县| 焉耆| 罗甸县| 淮南市| 永宁县| 六枝特区| 建宁县| 黄龙县| 都安| 万年县| 泰和县| 昌都县| 武山县| 兴国县| 保靖县| 都江堰市| 额尔古纳市| 河曲县| 沙湾县| 青岛市| 连南| 揭西县| 巴彦县| 博乐市| 荔浦县| 政和县| 从江县| 定结县| 清丰县| 滦平县| 盐池县| 马鞍山市| 马鞍山市|