页: 1
在一栏中,以这种格式储存美元价值:1.01美元、40.58美元等。
I m 试图用美元价值加起来
SELECT SUM(amount) FROM record WHERE date LIKE "+date+" "
然而,这并不奏效,大概是因为你可以增加案文。 我知道,这是理想的储存,但我会如何分配数额,以便我能够补充这些数额?
页: 1
在一栏中,以这种格式储存美元价值:1.01美元、40.58美元等。
I m 试图用美元价值加起来
SELECT SUM(amount) FROM record WHERE date LIKE "+date+" "
然而,这并不奏效,大概是因为你可以增加案文。 我知道,这是理想的储存,但我会如何分配数额,以便我能够补充这些数额?
诚然,正如你所说的那样,这远非储存价值的理想方式(从一开始就应在<条码>标准/代码>/<代码>real格式上)。
SELECT SUM(SUBSTR(amount, 2)) FROM record WHERE date LIKE "+date+" "
<代码>SUBSTR方法是一种文字功能,将包含案文的一个部分(在这种情况下,从一个起点指数)。 这里的问题是<条码><美元/代码>签字,这混淆了动态类型转换成认为你正在尝试加插。
现在应当做的是,作为Lite允许的dynamic打。 (以斜体表示,该数值用于比较,而不是集装箱)。
储存“
到uncald,我指的是12.3美元将作为第123卷储存。 (Use long
in You Java Code, and INTEERT
in the Prof.)
You:
// implement this any way you like!
long amount = getAmountFromDb();
// use default locale if you want
Locale locale = getLocaleFromSomewhere();
Currency currency = Currency.getInstance(locale);
NumberFormat format = NumberFormat.getCurrencyInstance(locale);
int scale = currency.getDefaultFractionDigits();
BigDecimal scaledAmount = new BigDecimal(unscaledBalance).movePointLeft(scale);
String textAmount = format.format(scaledAmount);
Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...
Check this, List<String> list = new ArrayList<String>(); for (int i = 0; i < 10000; i++) { String value = (""+UUID.randomUUID().getLeastSignificantBits()).substring(3, ...
I am in the middle of solving a problem where I think it s best suited for a decorator and a state pattern. The high level setting is something like a sandwich maker and dispenser, where I have a set ...
I have been trying to execute a MS SQL Server stored procedure via JDBC today and have been unsuccessful thus far. The stored procedure has 1 input and 1 output parameter. With every combination I ...
I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...
If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...
I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....
I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...