numberformatter

    2熱度

    1回答

    是否可以在PHP中僅使用NumberFormatter類的數字後綴。 例如: $nf = new NumberFormatter('en', NumberFormatter::ORDINAL); $out = $nf->format(10000); echo $out . "\n"; 會導致:'10,第000」 我只想: '日',即後綴。

    0熱度

    1回答

    我使用的JFormattedTextField在下面的文本字段中顯示的百分比值: NumberFormat percentDisplayFormat = NumberFormat.getPercentInstance(); NumberFormat editFormat = NumberFormat.getNumberInstance(); percentDisplayFormat.setM

    0熱度

    2回答

    嗨我在我的swift3應用程序中使用文本字段 - 我想當用戶在文本字段中輸入一個數字而不是英文數字textfield顯示波斯數字 - 我的文本字段鍵盤已設置爲只輸入數字,以便用戶不能使用文本帶鍵盤的文本字段,所以這裏是我的代碼不工作 override func viewDidLoad() { super.viewDidLoad() let numberFormatter = Numb

    1熱度

    1回答

    如果我使用money_format功能,正確打印的貨幣量在匈牙利格式: $ php -a Interactive mode enabled php > setlocale(LC_MONETARY, 'hu_HU'); php > $number = 1234.5672; php > echo money_format('%n', $number)."\n"; 1.234,57 Ft

    0熱度

    1回答

    我正在使用某種貨幣格式將貨幣符號/樣式設置爲用戶的本地設置。這是我的代碼。我認爲它工作正常。它位於我的viewDidLoad中。 let currencyFormat = NumberFormatter() currencyFormat.locale = NSLocale.current currencyFormat.usesGroupingSeparator = true currenc

    0熱度

    1回答

    這裏是強制性的「我是編程新手」,但是,我搜索了所有可用的答案,並得出結論認爲我的問題可能是比代碼更多的邏輯關係,但我可以對此也是錯誤的。我正在構建一個計算器應用程序,除了顯示屏中的numberFormatter(用於顯示逗號分隔符)之外,所有內容都正常工作。每當我嘗試在顯示器中設置數字格式時,我都無法使顯示屏顯示小數點和逗號。 如果我以小數點開始,.1234,我得到0.1234,如果我輸入1234

    4熱度

    2回答

    我對轉換錯誤有點困惑。 我遷移我的項目形式雨燕2.3〜3.0雨燕 func updateCelsiusLabel() { if let value = celsiusValue { //This was the original code (that worked but is) failing after migration //due to: Argume

    2熱度

    2回答

    我有一個Double:5096,54 我需要格式化爲:5.096,54(歐洲貨幣格式) 我試着用這段代碼沒有任何成功。 Locale l = Locale.getDefault(); // ("fr" in my case) // Get the formatter for the specific locale NumberFormat formatter = NumberFormat.ge

    1熱度

    1回答

    當用戶處於不同的語言環境時,我有以下iOS計算問題。在歐洲,小數點分隔符是「,」而在其他地區可能是「。」。只要用戶使用「。」的語言環境所有的計算都可以正常工作,但是當使用逗號時,我會得到一個錯誤。下面是簡單的代碼至今: if let expense = expenseTextField.text let expenseValue = Double(expense) let

    1熱度

    1回答

    我正在將遺留系統從PEAR的i18nv2類升級到PHP的內置INTL庫。當我指定一個像#,##0.##這樣的模式並運行NumberFormatter::format()像12345.1000這樣的數字時,我得到12,345.1不應該保留尾隨零?考慮到在許多地區,小數由逗號而不是小數字表示,是否有添加尾隨零的好方法? 解釋與代碼: $n = new NumberFormatter('en_CA',