如何将数字转换为单词

时间:2016-04-01 07:49:32

标签: php numbers

以下是此代码将数字转换为单词的代码 像这样

  • 100000十万

  • 10000000一千万

但我想转换一个这样的数字

  • 100000 1万

  • 10000000 1亿卢比

我该怎么做才能帮我解决这个问题 感谢

func collectionView(collectionView: UICollectionView, cellForItemAtIndexPath indexPath: NSIndexPath) -> UICollectionViewCell {
    let asset = self.assets![indexPath.row]
    var cell: UICollectionViewCell?
    var imageView: UIImageView?

    if asset.isVideo {
        cell = collectionView.dequeueReusableCellWithReuseIdentifier("CellVideo", forIndexPath: indexPath)
        imageView = cell?.contentView.viewWithTag(1) as? UIImageView
    } else {
        cell = collectionView.dequeueReusableCellWithReuseIdentifier("CellImage", forIndexPath: indexPath)
        imageView = cell?.contentView.viewWithTag(1) as? UIImageView
    }

    if let cell = cell, imageView = imageView {
        let layout = collectionView.collectionViewLayout as! UICollectionViewFlowLayout
        let tag = indexPath.row + 1
        cell.tag = tag
        asset.fetchImageWithSize(layout.itemSize.toPixel(), completeBlock: { image, info in
            if cell.tag == tag {
                imageView.image = image
            }
        })
    }

    return cell!
}

0 个答案:

没有答案